import { ValidationError } from "./errors.ts";
export type AuthorAddress = string;export type AuthorShortname = string;export type ShareAddress = string;export type ShareName = string;export type Path = string;export type Signature = string;export type Timestamp = number;export type LocalIndex = number;export type Base32String = string;export type FormatName = string;
export type ParsedAddress = { address: AuthorAddress; name: AuthorShortname; pubkey: Base32String;};
export interface DocBase<FormatType extends string> { format: FormatType; path: string; author: AuthorAddress; timestamp: Timestamp; signature: Signature; deleteAfter?: number | null; _localIndex?: number;}
export interface DocInputBase<FormatType extends string> { format: FormatType; path: string; timestamp?: Timestamp;}
export type DocWithFormat< FormatType extends string, DocType extends DocBase<string>,> = Extract<DocType, { "format": FormatType }>;
export type DocInputWithFormat< FormatType extends string, DocInputType extends DocInputBase<string>,> = Extract<DocInputType, { "format": FormatType }>;
export type DocAttachment = { stream: () => Promise<ReadableStream<Uint8Array>>; bytes: () => Promise<Uint8Array>;};
export type DocWithAttachment<D extends DocBase<string>> = D & { attachment: DocAttachment | undefined | ValidationError;};