import * as valibot from 'valibot'; import { InferOutput, GenericSchema, ObjectSchema } from 'valibot'; type Handler = (request: Request) => Result; type Enhancer = (next: Handler) => Handler; type Middleware = (init: Init) => Enhancer; /** * Schema of JSON-LD identifier (`@id`). Must be either IRI or blank node identifier (prefixed with `_:`). * * @see {@link https://www.w3.org/TR/json-ld11/#node-identifiers JSON-LD 1.1: Node Identifiers} */ declare const IdentifierSchema: valibot.UnionSchema<[GenericSchema<`_:${string}`>, GenericSchema<`https://${string}`>], "@id is required and must be an IRI or blank node identifier">; type Identifier = InferOutput; type GraphSubscriberRecord = { readonly upsertedNodeIdentifiers: ReadonlySet; }; type GraphSubscriber = (event: GraphSubscriberRecord) => void; type GraphNode = { '@id': Identifier; }; type GraphMiddleware = Middleware, ReadonlyMap, { readonly getState: () => GraphState; }>; type GraphState = ReadonlyMap; type ReadableGraph = { readonly act: (fn: (graph: WritableGraph) => void) => void; readonly getState: () => GraphState; readonly subscribe: (subscriber: GraphSubscriber) => void; }; type WritableGraph = { readonly getState: () => GraphState; readonly upsert: (...nodes: readonly TInput[]) => void; }; declare class Graph implements ReadableGraph { #private; constructor(firstMiddleware: GraphMiddleware, ...restMiddleware: readonly GraphMiddleware[]); act(fn: (graph: WritableGraph) => void): void; getState(): GraphState; subscribe(subscriber: GraphSubscriber): () => void; } declare const SlantNodeSchema: valibot.SchemaWithPipe, undefined>; readonly '@id': valibot.UnionSchema<[valibot.GenericSchema<`_:${string}`>, valibot.GenericSchema<`https://${string}`>], "@id is required and must be an IRI or blank node identifier">; readonly '@type': valibot.SchemaWithPipe, "@type must be array of string">, valibot.TransformAction, valibot.MinLengthAction]>; readonly hasPart: valibot.OptionalSchema, valibot.GenericSchema<`https://${string}`>], "@id is required and must be an IRI or blank node identifier">; readonly '@type': valibot.OptionalSchema, valibot.SchemaWithPipe, undefined>, valibot.MinLengthAction]>], "@type must be string or array of string with at least 1 element">, undefined>; }, "NodeReference must only have @id and optional @type">, valibot.TransformAction<{ '@id': `_:${string}` | `https://${string}`; '@type'?: string | string[] | undefined; }, Readonly<{ '@id': `_:${string}` | `https://${string}`; '@type'?: string | string[] | undefined; }>>]>, "hasPart must be array of NodeReference">, valibot.TransformAction[], readonly Readonly<{ '@id': `_:${string}` | `https://${string}`; '@type'?: string | string[] | undefined; }>[]>, valibot.MinLengthAction[], 1, "hasPart, if present, must have at least one element">]>, undefined>; readonly isPartOf: valibot.OptionalSchema, valibot.GenericSchema<`https://${string}`>], "@id is required and must be an IRI or blank node identifier">; readonly '@type': valibot.OptionalSchema, valibot.SchemaWithPipe, undefined>, valibot.MinLengthAction]>], "@type must be string or array of string with at least 1 element">, undefined>; }, "NodeReference must only have @id and optional @type">, valibot.TransformAction<{ '@id': `_:${string}` | `https://${string}`; '@type'?: string | string[] | undefined; }, Readonly<{ '@id': `_:${string}` | `https://${string}`; '@type'?: string | string[] | undefined; }>>]>, "isPartOf must be array of NodeReference">, valibot.TransformAction[], readonly Readonly<{ '@id': `_:${string}` | `https://${string}`; '@type'?: string | string[] | undefined; }>[]>, valibot.MinLengthAction[], 1, "isPartOf, if present, must have at least one element">]>, undefined>; }, valibot.SchemaWithPipe; readonly '@value': valibot.UnknownSchema; }, "JSON literal must only have @type and @value">, valibot.UnionSchema<[valibot.BooleanSchema, valibot.NumberSchema, valibot.StringSchema], "Only boolean, number, and string are allowed for JSON-LD literal">, valibot.SchemaWithPipe, valibot.GenericSchema<`https://${string}`>], "@id is required and must be an IRI or blank node identifier">; readonly '@type': valibot.OptionalSchema, valibot.SchemaWithPipe, undefined>, valibot.MinLengthAction]>], "@type must be string or array of string with at least 1 element">, undefined>; }, "NodeReference must only have @id and optional @type">, valibot.TransformAction<{ '@id': `_:${string}` | `https://${string}`; '@type'?: string | string[] | undefined; }, Readonly<{ '@id': `_:${string}` | `https://${string}`; '@type'?: string | string[] | undefined; }>>]>], "Properties of slant node must be array of JSON literal, literal or node reference">, undefined>, valibot.MinLengthAction<(string | number | boolean | { '@type': "@json"; '@value': unknown; } | Readonly<{ '@id': `_:${string}` | `https://${string}`; '@type'?: string | string[] | undefined; }>)[], 1, "Properties of slant node must be an array with at least 1 element">]>, undefined>, valibot.TransformAction<{ '@context'?: string | undefined; '@id': `_:${string}` | `https://${string}`; '@type': readonly string[]; hasPart?: readonly Readonly<{ '@id': `_:${string}` | `https://${string}`; '@type'?: string | string[] | undefined; }>[] | undefined; isPartOf?: readonly Readonly<{ '@id': `_:${string}` | `https://${string}`; '@type'?: string | string[] | undefined; }>[] | undefined; } & { [key: string]: (string | number | boolean | { '@type': "@json"; '@value': unknown; } | Readonly<{ '@id': `_:${string}` | `https://${string}`; '@type'?: string | string[] | undefined; }>)[]; }, Readonly<{ '@context'?: string | undefined; '@id': `_:${string}` | `https://${string}`; '@type': readonly string[]; hasPart?: readonly Readonly<{ '@id': `_:${string}` | `https://${string}`; '@type'?: string | string[] | undefined; }>[] | undefined; isPartOf?: readonly Readonly<{ '@id': `_:${string}` | `https://${string}`; '@type'?: string | string[] | undefined; }>[] | undefined; } & { [key: string]: (string | number | boolean | { '@type': "@json"; '@value': unknown; } | Readonly<{ '@id': `_:${string}` | `https://${string}`; '@type'?: string | string[] | undefined; }>)[]; }>>]>; type SlantNode = InferOutput> & { [key: string]: unknown; }; declare function isOfType(nodeObject: { '@type': readonly string[] | string; }, type: string): boolean; declare const MessageNodeSchema: valibot.SchemaWithPipe, valibot.GenericSchema<`https://${string}`>], "@id is required and must be an IRI or blank node identifier">; readonly '@type': valibot.SchemaWithPipe, undefined>, valibot.IncludesAction]>; readonly identifier: valibot.OptionalSchema, valibot.GenericSchema<`https://${string}`>], "@id is required and must be an IRI or blank node identifier">, undefined>, undefined>; readonly position: valibot.TupleSchema<[valibot.NumberSchema], undefined>; readonly sender: valibot.OptionalSchema, valibot.GenericSchema<`https://${string}`>], "@id is required and must be an IRI or blank node identifier">; readonly '@type': valibot.OptionalSchema, valibot.SchemaWithPipe, undefined>, valibot.MinLengthAction]>], "@type must be string or array of string with at least 1 element">, undefined>; }, "NodeReference must only have @id and optional @type">, valibot.TransformAction<{ '@id': `_:${string}` | `https://${string}`; '@type'?: string | string[] | undefined; }, Readonly<{ '@id': `_:${string}` | `https://${string}`; '@type'?: string | string[] | undefined; }>>]>], undefined>, undefined>; readonly 'urn:microsoft:webchat:direct-line-activity:raw-json': valibot.TupleSchema<[valibot.StrictObjectSchema<{ readonly '@type': valibot.LiteralSchema<"@json", undefined>; readonly '@value': valibot.UnknownSchema; }, "JSON literal must only have @type and @value">], undefined>; readonly 'urn:microsoft:webchat:direct-line-activity:type': valibot.TupleSchema<[valibot.StringSchema], undefined>; }, undefined>, valibot.ReadonlyAction<{ '@id': `_:${string}` | `https://${string}`; '@type': string[]; identifier?: (`_:${string}` | `https://${string}`)[] | undefined; position: [number]; sender?: [Readonly<{ '@id': `_:${string}` | `https://${string}`; '@type'?: string | string[] | undefined; }>] | undefined; 'urn:microsoft:webchat:direct-line-activity:raw-json': [{ '@type': "@json"; '@value': unknown; }]; 'urn:microsoft:webchat:direct-line-activity:type': [string]; }>]>, valibot.ObjectSchema<{ readonly '@type': valibot.SchemaWithPipe, undefined>, valibot.MinLengthAction, valibot.IncludesAction]>; readonly encodingFormat: valibot.TupleSchema<[valibot.PicklistSchema<["text/markdown", "text/plain"], undefined>], undefined>; readonly text: valibot.OptionalSchema], undefined>, undefined>; }, undefined>], undefined>, valibot.TransformAction] | undefined; 'urn:microsoft:webchat:direct-line-activity:raw-json': [{ '@type': "@json"; '@value': unknown; }]; 'urn:microsoft:webchat:direct-line-activity:type': [string]; }> & { '@type': string[]; encodingFormat: ["text/markdown" | "text/plain"]; text?: [string] | undefined; }, Readonly] | undefined; 'urn:microsoft:webchat:direct-line-activity:raw-json': [{ '@type': "@json"; '@value': unknown; }]; 'urn:microsoft:webchat:direct-line-activity:type': [string]; }> & { '@type': string[]; encodingFormat: ["text/markdown" | "text/plain"]; text?: [string] | undefined; }>>]>; type MessageNode = InferOutput; type AnyNode = Record & { readonly '@id': Identifier; readonly '@type': string | readonly string[]; }; declare class SlantGraph extends Graph { constructor(); } export { SlantGraph as S, IdentifierSchema as e, MessageNodeSchema as f, SlantNodeSchema as h, isOfType as i }; export type { GraphMiddleware as G, Identifier as I, MessageNode as M, ReadableGraph as R, WritableGraph as W, GraphNode as a, GraphState as b, GraphSubscriber as c, GraphSubscriberRecord as d, SlantNode as g };