@digitalculture/ochre-sdk
Version:
Node.js library for working with OCHRE (Online Cultural and Historical Research Environment) data
1,050 lines • 30.4 kB
TypeScript
//#region src/types/main.d.ts
/**
* Represents the core data structure containing item information and metadata
*/
type Data<T extends DataCategory, U extends DataCategory> = {
uuid: string;
belongsTo: {
uuid: string;
abbreviation: string;
};
publicationDateTime: Date;
metadata: Metadata;
item: Tree<T, U> | Set<T> | Resource | SpatialUnit | Concept | Period | Bibliography | Person | PropertyValue;
};
type DataCategory = "tree" | "set" | "resource" | "spatialUnit" | "concept" | "period" | "bibliography" | "person" | "propertyValue";
/**
* Basic identification information used across multiple types
*/
type Identification = {
label: string;
abbreviation: string;
};
/**
* Metadata information for items including project, publisher and language details
*/
type Metadata = {
project: {
identification: Identification & {
website: string | null;
};
} | null;
item: {
identification: Identification;
category: string;
type: string;
maxLength: number | null;
} | null;
dataset: string;
publisher: string;
languages: Array<string>;
identifier: string;
description: string;
};
/**
* Represents a single item in a context hierarchy with its metadata
*/
type ContextItem = {
uuid: string;
publicationDateTime: Date | null;
number: number;
content: string;
};
/**
* Represents a node in the context tree containing tree, project and spatial unit information
*/
type ContextNode = {
tree: ContextItem;
project: ContextItem;
spatialUnit: Array<ContextItem>;
};
/**
* Contains the full context information including nodes and display path
*/
type Context = {
nodes: Array<ContextNode>;
displayPath: string;
};
/**
* License information for content items
*/
type License = {
content: string;
url: string;
};
/**
* Represents a person (author, creator, etc.) with their identification and metadata
*/
type Person = {
uuid: string;
category: "person";
publicationDateTime: Date | null;
type: string | null;
number: number | null;
context: Context | null;
availability: License | null;
date: Date | null;
identification: Identification | null;
address: {
country: string | null;
city: string | null;
state: string | null;
} | null;
description: string | null;
coordinates: Coordinates;
content: string | null;
notes: Array<Note>;
events: Array<Event>;
properties: Array<Property>;
};
/**
* Represents a note with number, title and content
*/
type Note = {
number: number;
title: string | null;
content: string;
};
/**
* Represents an image with its metadata and content
*/
type Image = {
publicationDateTime: Date | null;
identification: Identification | null;
url: string | null;
htmlPrefix: string | null;
content: string | null;
widthPreview: number | null;
heightPreview: number | null;
width: number | null;
height: number | null;
};
/**
* Represents a link to another item with optional image and bibliographic references
*/
type Link = {
uuid: string | null;
publicationDateTime: Date | null;
type: string | null;
category: string | null;
identification: Identification | null;
content: string | null;
href: string | null;
fileFormat: string | null;
fileSize: number | null;
image: {
isInline: boolean;
isPrimary: boolean;
heightPreview: number;
widthPreview: number;
height: number;
width: number;
} | null;
bibliographies: Array<Bibliography> | null;
};
/**
* Represents a clickable/interactive area on an image map
*/
type ImageMapArea = {
uuid: string;
publicationDateTime: Date | null;
type: string;
title: string;
shape: "rectangle" | "circle" | "polygon";
coords: Array<number>;
};
/**
* Contains image map areas and dimensions
*/
type ImageMap = {
area: Array<ImageMapArea>;
width: number;
height: number;
};
/**
* Geographic coordinates item with optional type and label
*/
type CoordinatesItem = {
type: "point";
latitude: number;
longitude: number;
altitude: number | null;
source: {
context: "self";
uuid: string;
label: string;
} | {
context: "related";
uuid: string;
label: string;
value: string;
} | {
context: "inherited";
item: {
uuid: string;
label: string;
};
uuid: string;
label: string;
} | null;
} | {
type: "plane";
minimum: {
latitude: number;
longitude: number;
};
maximum: {
latitude: number;
longitude: number;
};
source: {
context: "self";
uuid: string;
label: string;
} | {
context: "related";
uuid: string;
label: string;
value: string;
} | {
context: "inherited";
item: {
uuid: string;
label: string;
};
uuid: string;
label: string;
} | null;
};
/**
* Geographic coordinates with optional type and label
*/
type Coordinates = Array<CoordinatesItem>;
/**
* Represents an observation with notes, links and properties
*/
type Observation = {
number: number;
date: Date | null;
observers: Array<string> | Array<Person>;
notes: Array<Note>;
links: Array<Link>;
properties: Array<Property>;
};
/**
* Represents an event with date, label and optional agent
*/
type Event = {
date: Date | null;
label: string;
agent: {
uuid: string;
content: string;
} | null;
};
/**
* Represents an interpretation with date and properties
*/
type Interpretation = {
date: Date | null;
number: number;
properties: Array<Property>;
};
/**
* Represents a resource item with associated metadata, content and relationships
*/
type Resource = {
uuid: string;
category: "resource";
publicationDateTime: Date | null;
type: string;
number: number;
context: Context | null;
license: License | null;
copyright: string | null;
identification: Identification;
date: Date | null;
image: Image | null;
creators: Array<Person>;
notes: Array<Note>;
description: string;
coordinates: Coordinates;
document: string | null;
href: string | null;
fileFormat: string | null;
fileSize: number | null;
imageMap: ImageMap | null;
periods: Array<Period>;
links: Array<Link>;
reverseLinks: Array<Link>;
properties: Array<Property>;
bibliographies: Array<Bibliography>;
resources: Array<Resource>;
};
/**
* Represents a spatial unit with geographic coordinates and observations
*/
type SpatialUnit = {
uuid: string;
category: "spatialUnit";
publicationDateTime: Date | null;
number: number;
context: Context | null;
license: License | null;
identification: Identification;
image: Image | null;
description: string | null;
coordinates: Coordinates;
mapData: {
geoJSON: {
multiPolygon: string;
EPSG: number;
};
} | null;
observations: Array<Observation>;
events: Array<Event>;
properties: Array<Property>;
};
/**
* Represents a concept with associated interpretations
*/
type Concept = {
uuid: string;
category: "concept";
publicationDateTime: Date | null;
number: number;
license: License | null;
context: Context | null;
identification: Identification;
interpretations: Array<Interpretation>;
};
/**
* Represents a set that can contain resources, spatial units and concepts
*/
type Set<T extends DataCategory> = {
uuid: string;
category: "set";
itemCategory: T;
publicationDateTime: Date | null;
type: string;
number: number;
date: Date | null;
license: License | null;
identification: Identification;
isSuppressingBlanks: boolean;
description: string;
creators: Array<Person>;
items: T extends "resource" ? Array<Resource> : T extends "spatialUnit" ? Array<SpatialUnit> : T extends "concept" ? Array<Concept> : T extends "period" ? Array<Period> : T extends "bibliography" ? Array<Bibliography> : T extends "person" ? Array<Person> : T extends "propertyValue" ? Array<PropertyValue> : never;
};
/**
* Represents a bibliography entry with citation and publication information
*/
type Bibliography = {
uuid: string | null;
zoteroId: string | null;
category: "bibliography";
publicationDateTime: Date | null;
type: string | null;
number: number | null;
identification: Identification | null;
projectIdentification: Identification | null;
context: Context | null;
citation: {
details: string | null;
format: string | null;
short: string | null;
long: string | null;
};
publicationInfo: {
publishers: Array<Person>;
startDate: Date | null;
};
entryInfo: {
startIssue: string;
startVolume: string;
} | null;
source: {
resource: Pick<Resource, "uuid" | "publicationDateTime" | "type" | "identification"> | null;
documentUrl: string | null;
};
periods: Array<Period>;
authors: Array<Person>;
properties: Array<Property>;
};
/**
* Represents a time period with identification
*/
type Period = {
uuid: string;
category: "period";
publicationDateTime: Date | null;
type: string | null;
number: number | null;
identification: Identification;
description: string | null;
};
/**
* Represents a property value with type information
*/
type PropertyValue = {
uuid: string;
category: "propertyValue";
number: number;
publicationDateTime: Date | null;
context: Context | null;
availability: License | null;
identification: Identification;
date: Date | null;
creators: Array<Person>;
description: string;
notes: Array<Note>;
links: Array<Link>;
};
type PropertyValueContentType = "string" | "integer" | "decimal" | "boolean" | "date" | "dateTime" | "time" | "coordinate" | "IDREF";
/**
* Represents a property value with type information
*/
type PropertyValueContent<T extends PropertyValueContentType> = {
content: (T extends "integer" ? number : T extends "decimal" ? number : T extends "time" ? number : T extends "boolean" ? boolean : string) | null;
dataType: T;
label: string | null;
isUncertain: boolean;
unit: string | null;
category: string | null;
type: string | null;
uuid: string | null;
publicationDateTime: Date | null;
};
/**
* Represents a property with label, values and nested properties
*/
type Property<T extends PropertyValueContentType = PropertyValueContentType> = {
uuid: string;
label: string;
values: Array<PropertyValueContent<T>>;
comment: string | null;
properties: Array<Property>;
};
/**
* Represents a tree structure containing resources, spatial units and concepts
*/
type Tree<T extends DataCategory, U extends DataCategory> = {
uuid: string;
category: "tree";
publicationDateTime: Date | null;
type: string;
number: number;
date: Date | null;
license: License | null;
identification: Identification;
creators: Array<Person>;
properties: Array<Property>;
items: T extends "resource" ? Array<Resource> : T extends "spatialUnit" ? Array<SpatialUnit> : T extends "concept" ? Array<Concept> : T extends "period" ? Array<Period> : T extends "bibliography" ? Array<Bibliography> : T extends "person" ? Array<Person> : T extends "propertyValue" ? Array<PropertyValue> : T extends "set" ? Array<Set<U>> : never;
};
/**
* Represents a gallery with its identification, project identification, resources and max length
*/
type Gallery = {
identification: Identification;
projectIdentification: Identification;
resources: Array<Resource>;
maxLength: number;
};
/**
* Represents a metadata object given a UUID
*/
type UuidMetadata = {
item: {
uuid: string;
name: string;
type: string;
};
project: {
name: string;
website: string | null;
};
} | null;
/**
* Represents a level context item with a variable and value
*/
type LevelContextItem = {
variableUuid: string;
valueUuid: string | null;
};
/**
* Represents a level context with a context item
*/
type LevelContext = {
context: Array<LevelContextItem>;
};
/**
* Represents a website with its properties and elements
*/
type Website = {
uuid: string;
publicationDateTime: Date | null;
identification: Identification;
project: {
name: string;
website: string | null;
};
creators: Array<Person>;
license: License | null;
pages: Array<Webpage>;
sidebar: {
elements: Array<WebElement>;
title: WebElement["title"];
layout: "start" | "end";
mobileLayout: "default" | "inline";
cssStyles: Array<Style>;
cssStylesMobile: Array<Style>;
} | null;
properties: WebsiteProperties;
globalOptions: {
collectionUuids: Array<string>;
contexts: {
flatten: Array<LevelContext>;
suppress: Array<LevelContext>;
search: Array<LevelContext>;
detail: Array<LevelContext>;
download: Array<LevelContext>;
label: Array<LevelContext>;
};
};
};
/**
* Properties for configuring website display and styling
*/
type WebsiteProperties = {
type: "traditional" | "digital-collection" | "plum" | "cedar" | "elm" | "maple" | "oak" | "palm";
privacy: "public" | "password" | "private";
status: "development" | "preview" | "production";
contact: {
name: string;
email: string | null;
} | null;
isHeaderDisplayed: boolean;
headerVariant: "default" | "floating" | "inline";
headerAlignment: "start" | "center" | "end";
isHeaderProjectDisplayed: boolean;
isFooterDisplayed: boolean;
isSidebarDisplayed: boolean;
supportsThemeToggle: boolean;
defaultTheme: "light" | "dark" | null;
logoUrl: string | null;
};
type Webpage = {
title: string;
slug: string;
properties: WebpageProperties;
items: Array<WebElement | WebBlock>;
webpages: Array<Webpage>;
};
/**
* Properties for configuring webpage display and styling
*/
type WebpageProperties = {
displayedInHeader: boolean;
width: "full" | "large" | "narrow" | "default";
variant: "default" | "no-background";
backgroundImageUrl: string | null;
isSidebarDisplayed: boolean;
isBreadcrumbsDisplayed: boolean;
cssStyles: Array<Style>;
cssStylesMobile: Array<Style>;
};
/**
* Base properties for web elements
*/
type WebElement = {
uuid: string;
type: "element";
title: {
label: string;
variant: "default" | "simple";
properties: {
isNameDisplayed: boolean;
isDescriptionDisplayed: boolean;
isDateDisplayed: boolean;
isCreatorsDisplayed: boolean;
};
};
isDisplayedInBlockSectionSidebar: boolean;
cssStyles: Array<Style>;
cssStylesMobile: Array<Style>;
} & WebElementComponent;
/**
* Union type of all possible web element components
*/
type WebElementComponent = {
component: "annotated-document";
documentId: string;
} | {
component: "annotated-image";
imageUuid: string;
isSearchable: boolean;
} | {
component: "audio-player";
audioId: string;
isSpeedControlsDisplayed: boolean;
isVolumeControlsDisplayed: boolean;
isSeekBarDisplayed: boolean;
} | {
component: "bibliography";
bibliographies: Array<Bibliography>;
layout: "long" | "short";
} | {
component: "entries";
entriesId: string;
variant: "entry" | "item";
isSearchable: boolean;
} | {
component: "button";
variant: "default" | "transparent";
href: string;
isExternal: boolean;
label: string;
icon: string | null;
} | {
component: "collection";
collectionId: string;
variant: "full" | "highlights";
itemVariant: "default" | "card";
paginationVariant: "default" | "numeric";
isSearchable: boolean;
showCount: boolean;
layout: "image-top" | "image-bottom" | "image-start" | "image-end";
} | {
component: "empty-space";
height: string | null;
width: string | null;
} | {
component: "filter-categories";
filterId: string;
} | {
component: "iframe";
href: string;
height: string | null;
width: string | null;
} | {
component: "iiif-viewer";
IIIFId: string;
} | {
component: "image";
images: Array<WebImage>;
variant: "default" | "carousel";
width: number | null;
height: number | null;
isFullWidth: boolean;
isFullHeight: boolean;
imageQuality: "high" | "low";
captionSource: "name" | "abbreviation" | "description";
captionLayout: "top" | "bottom" | "inset" | "suppress";
altTextSource: "name" | "abbreviation" | "description";
isTransparentBackground: boolean;
isCover: boolean;
carouselOptions: {
secondsPerImage: number;
} | null;
} | {
component: "image-gallery";
galleryId: string;
isSearchable: boolean;
} | {
component: "map";
mapId: string;
customBasemap: string | null;
isControlsDisplayed: boolean;
isInteractive: boolean;
isClustered: boolean;
isUsingPins: boolean;
isFullHeight: boolean;
} | {
component: "n-columns";
columns: Array<WebElement>;
} | {
component: "n-rows";
rows: Array<WebElement>;
} | {
component: "network-graph";
} | {
component: "search-bar";
variant: "default" | "full";
} | {
component: "table";
tableId: string;
} | {
component: "text";
variant: "title" | "block" | "banner";
heading: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | null;
content: string;
} | {
component: "timeline";
timelineId: string;
} | {
component: "video";
isChaptersDislayed: boolean;
};
/**
* Represents an image used in web elements
*/
type WebImage = {
url: string;
label: string | null;
width: number;
height: number;
};
/**
* Represents a CSS style with label and value
*/
type Style = {
label: string;
value: string;
};
/**
* Represents a block of vertical or horizontal content alignment
*/
type WebBlock = {
uuid: string;
type: "block";
layout: "vertical" | "horizontal" | "grid";
items: Array<WebElement | WebBlock>;
properties: {
/**
* valid `gridTemplateColumns` or `gridTemplateRows` CSS property value
*/
spacing: string | undefined;
/**
* `gap` CSS property value
*/
gap: string | undefined;
/**
* `align-items` CSS property value
*/
alignItems: "stretch" | "start" | "center" | "end" | "space-between";
/**
* `justify-content` CSS property value
*/
justifyContent: "stretch" | "start" | "center" | "end" | "space-between";
sectionSidebarItems: Array<WebSectionSidebarItem> | null;
};
propertiesMobile: Record<string, string> | null;
cssStyles: Array<Style>;
cssStylesMobile: Array<Style>;
};
type WebSectionSidebarItem = {
uuid: string;
type: "block" | "element";
name: string | null;
items: Array<WebSectionSidebarItem> | null;
};
//#endregion
//#region src/utils/fetchers/gallery.d.ts
/**
* Fetches and parses a gallery from the OCHRE API
*
* @param uuid - The UUID of the gallery
* @param filter - The filter to apply to the gallery
* @param page - The page number to fetch
* @param perPage - The number of items per page
* @returns The parsed gallery or null if the fetch/parse fails
*
* @example
* ```ts
* const gallery = await fetchGallery("9c4da06b-f15e-40af-a747-0933eaf3587e", "1978", 1, 12);
* if (gallery === null) {
* console.error("Failed to fetch gallery");
* return;
* }
* console.log(`Fetched gallery: ${gallery.identification.label}`);
* console.log(`Contains ${gallery.resources.length.toLocaleString()} resources`);
* ```
*
* @remarks
* The returned gallery includes:
* - Gallery metadata and identification
* - Project identification
* - Resources (gallery items)
*/
declare function fetchGallery(uuid: string, filter: string, page: number, perPage: number, customFetch?: (input: string | URL | globalThis.Request, init?: RequestInit) => Promise<Response>): Promise<{
item: Gallery | null;
error: null;
} | {
item: null;
error: string;
}>;
//#endregion
//#region src/utils/fetchers/item.d.ts
/**
* Fetches and parses an OCHRE item from the OCHRE API
*
* @param uuid - The UUID of the OCHRE item to fetch
* @returns Object containing the parsed OCHRE item and its metadata, or null if the fetch/parse fails
*
* @example
* ```ts
* const result = await fetchItem("123e4567-e89b-12d3-a456-426614174000");
* if (result === null) {
* console.error("Failed to fetch OCHRE item");
* return;
* }
* const { metadata, belongsTo, item, category } = result;
* console.log(`Fetched OCHRE item: ${item.identification.label} with category ${category}`);
* ```
*
* Or, if you want to fetch a specific category, you can do so by passing the category as an argument:
* ```ts
* const result = await fetchItem("123e4567-e89b-12d3-a456-426614174000", "resource");
* const { metadata, belongsTo, item, category } = result;
* console.log(item.category); // "resource"
* ```
*
* @remarks
* The returned OCHRE item includes:
* - Item metadata
* - Item belongsTo information
* - Item content
* - Item category
*
* If the fetch/parse fails, the returned object will have an `error` property.
*/
declare function fetchItem<T extends DataCategory, U extends DataCategory>(uuid: string, category?: T, setCategory?: T extends "set" ? U : never, customFetch?: (input: string | URL | globalThis.Request, init?: RequestInit) => Promise<Response>): Promise<{
error: null;
metadata: Metadata;
belongsTo: {
uuid: string;
abbreviation: string;
};
item: T extends "resource" ? Resource : T extends "spatialUnit" ? SpatialUnit : T extends "concept" ? Concept : T extends "period" ? Period : T extends "bibliography" ? Bibliography : T extends "person" ? Person : T extends "propertyValue" ? PropertyValue : T extends "set" ? Set<U> : T extends "tree" ? Tree<T, U> : never;
category: T;
} | {
error: string;
metadata: never;
belongsTo: never;
item: never;
category: never;
}>;
//#endregion
//#region src/utils/fetchers/uuid-metadata.d.ts
/**
* Fetches raw OCHRE metadata by UUID from the OCHRE API
*
* @param uuid - The UUID of the OCHRE item to fetch
* @returns An object containing the OCHRE metadata or an error message
*
* @example
* ```ts
* const { item, error } = await fetchByUuidMetadata("123e4567-e89b-12d3-a456-426614174000");
* if (error !== null) {
* console.error(`Failed to fetch: ${error}`);
* return;
* }
* // Process data...
* ```
*/
declare function fetchByUuidMetadata(uuid: string, customFetch?: (input: string | URL | globalThis.Request, init?: RequestInit) => Promise<Response>): Promise<{
item: UuidMetadata | null;
error: string | null;
}>;
//#endregion
//#region src/utils/fetchers/website.d.ts
/**
* Fetches and parses a website configuration from the OCHRE API
*
* @param abbreviation - The abbreviation identifier for the website
* @returns The parsed website configuration or null if the fetch/parse fails
*
* @example
* ```ts
* const website = await fetchWebsite("guerrilla-television");
* if (website === null) {
* console.error("Failed to fetch website");
* return;
* }
* console.log(`Fetched website: ${website.identification.label}`);
* console.log(`Contains ${website.pages.length.toLocaleString()} pages`);
* ```
*
* @remarks
* The returned website configuration includes:
* - Website metadata and identification
* - Page structure and content
* - Layout and styling properties
* - Navigation configuration
* - Sidebar elements
* - Project information
* - Creator details
*
* The abbreviation is case-insensitive and should match the website's configured abbreviation in OCHRE.
*/
declare function fetchWebsite(abbreviation: string, customFetch?: (input: string | URL | globalThis.Request, init?: RequestInit) => Promise<Response>): Promise<[null, Website] | [string, null]>;
//#endregion
//#region src/utils/getters.d.ts
/**
* Options for property search operations
*/
type PropertyOptions = {
/** Whether to recursively search through nested properties */
includeNestedProperties: boolean;
};
/**
* Finds a property by its UUID in an array of properties
*
* @param properties - Array of properties to search through
* @param uuid - The UUID to search for
* @param options - Search options, including whether to include nested properties
* @returns The matching Property object, or null if not found
*
* @example
* ```ts
* const property = getPropertyByUuid(properties, "123e4567-e89b-12d3-a456-426614174000", { includeNestedProperties: true });
* if (property) {
* console.log(property.values);
* }
* ```
*/
declare function getPropertyByUuid(properties: Array<Property>, uuid: string, options?: PropertyOptions): Property | null;
/**
* Retrieves all values for a property with the given UUID
*
* @param properties - Array of properties to search through
* @param uuid - The UUID to search for
* @param options - Search options, including whether to include nested properties
* @returns Array of property values as strings, or null if property not found
*
* @example
* ```ts
* const values = getPropertyValuesByUuid(properties, "123e4567-e89b-12d3-a456-426614174000");
* if (values) {
* for (const value of values) {
* console.log(value);
* }
* }
* ```
*/
declare function getPropertyValuesByUuid(properties: Array<Property>, uuid: string, options?: PropertyOptions): Array<string | number | boolean | Date | null> | null;
/**
* Gets the first value of a property with the given UUID
*
* @param properties - Array of properties to search through
* @param uuid - The UUID to search for
* @param options - Search options, including whether to include nested properties
* @returns The first property value as string, or null if property not found
*
* @example
* ```ts
* const title = getPropertyValueByUuid(properties, "123e4567-e89b-12d3-a456-426614174000");
* if (title) {
* console.log(`Document title: ${title}`);
* }
* ```
*/
declare function getPropertyValueByUuid(properties: Array<Property>, uuid: string, options?: PropertyOptions): string | number | boolean | Date | null;
/**
* Finds a property by its label in an array of properties
*
* @param properties - Array of properties to search through
* @param label - The label to search for
* @param options - Search options, including whether to include nested properties
* @returns The matching Property object, or null if not found
*
* @example
* ```ts
* const property = getPropertyByLabel(properties, "author", { includeNestedProperties: true });
* if (property) {
* console.log(property.values);
* }
* ```
*/
declare function getPropertyByLabel(properties: Array<Property>, label: string, options?: PropertyOptions): Property | null;
/**
* Retrieves all values for a property with the given label
*
* @param properties - Array of properties to search through
* @param label - The label to search for
* @param options - Search options, including whether to include nested properties
* @returns Array of property values as strings, or null if property not found
*
* @example
* ```ts
* const values = getPropertyValuesByLabel(properties, "keywords");
* if (values) {
* for (const value of values) {
* console.log(value);
* }
* }
* ```
*/
declare function getPropertyValuesByLabel(properties: Array<Property>, label: string, options?: PropertyOptions): Array<string | number | boolean | Date | null> | null;
/**
* Gets the first value of a property with the given label
*
* @param properties - Array of properties to search through
* @param label - The label to search for
* @param options - Search options, including whether to include nested properties
* @returns The first property value as string, or null if property not found
*
* @example
* ```ts
* const title = getPropertyValueByLabel(properties, "title");
* if (title) {
* console.log(`Document title: ${title}`);
* }
* ```
*/
declare function getPropertyValueByLabel(properties: Array<Property>, label: string, options?: PropertyOptions): string | number | boolean | Date | null;
/**
* Gets all unique properties from an array of properties
*
* @param properties - Array of properties to get unique properties from
* @param options - Search options, including whether to include nested properties
* @returns Array of unique properties
*
* @example
* ```ts
* const properties = getAllUniqueProperties(properties, { includeNestedProperties: true });
* console.log(`Available properties: ${properties.map((p) => p.label).join(", ")}`);
* ```
*/
declare function getUniqueProperties(properties: Array<Property>, options?: PropertyOptions): Array<Property>;
/**
* Gets all unique property labels from an array of properties
*
* @param properties - Array of properties to get unique property labels from
* @param options - Search options, including whether to include nested properties
* @returns Array of unique property labels
*
* @example
* ```ts
* const properties = getAllUniquePropertyLabels(properties, { includeNestedProperties: true });
* console.log(`Available properties: ${properties.join(", ")}`);
* ```
*/
declare function getUniquePropertyLabels(properties: Array<Property>, options?: PropertyOptions): Array<string>;
/**
* Filters a property based on a label and value criteria
*
* @param property - The property to filter
* @param filter - Filter criteria containing label and value to match
* @param filter.label - The label to filter by
* @param filter.value - The value to filter by
* @param options - Search options, including whether to include nested properties
* @returns True if the property matches the filter criteria, false otherwise
*
* @example
* ```ts
* const matches = filterProperties(property, {
* label: "category",
* value: "book"
* });
* if (matches) {
* console.log("Property matches filter criteria");
* }
* ```
*/
declare function filterProperties(property: Property, filter: {
label: string;
value: string | number | boolean | Date;
}, options?: PropertyOptions): boolean;
//#endregion
export { Bibliography, Concept, Context, ContextItem, ContextNode, Coordinates, CoordinatesItem, Data, DataCategory, Event, Gallery, Identification, Image, ImageMap, ImageMapArea, Interpretation, LevelContext, LevelContextItem, License, Link, Metadata, Note, Observation, Period, Person, Property, PropertyValue, PropertyValueContent, PropertyValueContentType, Resource, Set, SpatialUnit, Style, Tree, UuidMetadata, WebBlock, WebElement, WebElementComponent, WebImage, WebSectionSidebarItem, Webpage, WebpageProperties, Website, WebsiteProperties, fetchByUuidMetadata, fetchGallery, fetchItem, fetchWebsite, filterProperties, getPropertyByLabel, getPropertyByUuid, getPropertyValueByLabel, getPropertyValueByUuid, getPropertyValuesByLabel, getPropertyValuesByUuid, getUniqueProperties, getUniquePropertyLabels };