// Copyright 2024 Matthew Rich . All rights reserved. package data import ( "errors" "net/url" "decl/internal/transport" ) var ( ErrInvalidURI error = errors.New("Invalid URI") ) type URIParser interface { URL() *url.URL NewResource(document Document) (newResource Resource, err error) ConstructResource(res Resource) (err error) Converter() (converter Converter, err error) Exists() bool ContentReaderStream() (*transport.Reader, error) ContentWriterStream() (*transport.Writer, error) String() string SetURL(url *url.URL) Extension() (string, string) ContentType() string IsEmpty() bool } type Identifier interface { URI() string SetParsedURI(URIParser) error } type DocumentElement interface { Identifier } type Selector[Item comparable] func(r Item) bool type ResourceSelector Selector[Resource] type DeclarationSelector Selector[Declaration] type BlockSelector Selector[Block] type ElementSelector Selector[DocumentElement]