import { type Result } from '../utils.ts'; import { type ActorIdentifier } from './at-identifier.ts'; import { type Did } from './did.ts'; import { type Nsid } from './nsid.ts'; import { type RecordKey } from './record-key.ts'; /** * represents a general AT Protocol URI, representing either an entire * repository, a specific collection within a repository, or a record. * * it allows using handles over DIDs, but this means that it won't be stable. */ export type ResourceUri = `at://${ActorIdentifier}` | `at://${ActorIdentifier}/${Nsid}` | `at://${ActorIdentifier}/${Nsid}/${RecordKey}`; export type ParsedResourceUri = { repo: ActorIdentifier; collection: undefined; rkey: undefined; fragment: string | undefined; } | { repo: ActorIdentifier; collection: Nsid; rkey: undefined; fragment: string | undefined; } | { repo: ActorIdentifier; collection: Nsid; rkey: RecordKey; fragment: string | undefined; }; export declare const isResourceUri: (input: unknown) => input is ResourceUri; export declare const parseResourceUri: (input: string) => Result; /** * represents a canonical AT Protocol URI for a specific record. * * this URI format uses the account's DID as the authority, ensuring that * the URI remains valid even as the account changes handles, uniquely * identifying a specific piece of record within AT Protocol. */ export type CanonicalResourceUri = `at://${Did}/${Nsid}/${RecordKey}`; export type ParsedCanonicalResourceUri = { repo: Did; collection: Nsid; rkey: RecordKey; fragment: string | undefined; }; export declare const isCanonicalResourceUri: (input: unknown) => input is `at://did:${string}:${string}/${string}.${string}.${string}/${string}`; export declare const parseCanonicalResourceUri: (input: string) => Result; //# sourceMappingURL=at-uri.d.ts.map