import { type Identity } from "../crypto/identity"; import type { OpBody, SignedOp } from "./types"; /** Lengths are UTF-16 code units (JavaScript string length). */ export declare const MAX_TEXT = 10000; /** The longest an op may be, as JSON, so one op can never be a way to fill someone's storage. */ export declare const MAX_OP: number; /** Far beyond any real log, far below where clock arithmetic could overflow. */ export declare const MAX_CLOCK: number; /** Latest valid `at` in ms (about the year 6400); new ops stay at it rather than fail. */ export declare const MAX_AT: number; export declare const LIMITS: { readonly doc: 64; readonly path: 2000; readonly snapshot: 500; readonly anchorId: 200; readonly quote: 10000; readonly context: 64; readonly viewEntries: 16; readonly viewKey: 64; readonly viewValue: 200; readonly mentions: 20; readonly name: 200; readonly head: 120; readonly heads: 3; }; /** Who a mention names: a writer's key, or a person the page or an add-on supplied (`host:`, `gh:`). */ /** A way to reach someone that they chose to share: an email address, or a GitHub name (`gh:octocat`). */ export declare const CONTACT: RegExp; export declare const isEmoji: (s: unknown) => s is string; export declare function signOp(body: OpBody, identity: Identity): Promise; export declare function isAnchor(a: unknown): boolean; /** Shape checks that need nothing but the op itself. */ export declare function isWellFormed(op: unknown): op is SignedOp; export declare function isAuthentic(op: SignedOp): Promise; /** A change anyone can check: well formed, and signed by the key it names as its writer. */ export declare function checkOp(op: unknown): Promise; /** * Total order every peer agrees on: by clock, then time written, then author, then id. Time comes * before author so one writer's actions keep their order when many ops share a clock (for example * once a peer has pushed it to the cap). */ export declare function compareOps(a: SignedOp, b: SignedOp): number;