import * as wasm from '../wasm.js'; import type { EvoSDK } from '../sdk.js'; export declare class DocumentsFacade { private sdk; constructor(sdk: EvoSDK); query(query: wasm.DocumentsQuery): Promise>; queryWithProof(query: wasm.DocumentsQuery): Promise>>; /** * Chained document query — a provable semi-join: * `SELECT * FROM WHERE $id IN * (SELECT FROM WHERE ...)`. * * "Posts I liked" in one verified round trip: inner `like` through * its byLiker-style index, join `postId`, outer `post`. Both halves * ride ONE merged proof — a single quorum-signed state root by * construction — and the outer query is re-derived and checked * against the proven inner values, so the responding node cannot * steer the join. Paginate on the inner query with a range clause on * the join property. */ chained(query: wasm.ChainedDocumentsQuery): Promise; chainedWithProof(query: wasm.ChainedDocumentsQuery): Promise>; /** * Composite document query: a page plus the sub-queries derived from * it (by-id joins, indexed lookups, grouped counts, siblings), in ONE * verified round trip. * * A feed page in a single call: the posts, their like counts, the * posts they quote, their authors' profiles, and the viewer's own * likes on them. Everything rides ONE merged proof under one * quorum-signed state root, and every sub-query is re-derived from * the proven page, so the responding node cannot substitute, omit, * or inject a sub-result. Paginate with a range clause on the page's * ordering property. */ composite(query: wasm.CompositeDocumentsQuery): Promise; compositeWithProof(query: wasm.CompositeDocumentsQuery): Promise>; history(query: wasm.DocumentHistoryQuery): Promise>; historyWithProof(query: wasm.DocumentHistoryQuery): Promise>>; get(contractId: wasm.IdentifierLike, type: string, documentId: wasm.IdentifierLike): Promise; getWithProof(contractId: wasm.IdentifierLike, type: string, documentId: wasm.IdentifierLike): Promise>; /** * Creates a document and resolves to the confirmed Document as Platform * committed it, consensus-populated system fields included — keep this * instance when you later intend to delete an indexOnly document whose * type requires `$createdAt`. A document of a contested index joins a * contest: `options.contestFund` is the most, in credits, it pays into it. * For an indexOnly type the proof shows the document's entry at the proof's * block, not that this create wrote it: no stronger proof exists for one. */ create(options: wasm.DocumentCreateOptions): Promise; /** * The prefunded voting balance a create of `document` states to join the * contest it enters (a DPNS name, a moderation charter): the contested index * and the fund to join it now, which from protocol version 14 doubles once * the contest holds 250 contenders and again for every 50 more. Undefined * when the document joins no contest. {@link create} states it itself; a * transition built by hand passes it as `prefundedVotingBalance` to * `new DocumentCreateTransition`. Its `credits` alone is what the Rust SDK's * `contest_fund_to_join` returns; this is its `prefunded_voting_balance_to_join`. */ contestFundToJoin(document: wasm.Document): Promise; replace(options: wasm.DocumentReplaceOptions): Promise; /** * Deletes a document and resolves once the proof shows it gone. For an * indexOnly type the proof shows the document's entry gone at the proof's * block, not that this delete removed it: no stronger proof exists for one. */ delete(options: wasm.DocumentDeleteOptions): Promise; transfer(options: wasm.DocumentTransferOptions): Promise; purchase(options: wasm.DocumentPurchaseOptions): Promise; setPrice(options: wasm.DocumentSetPriceOptions): Promise; count(query: wasm.DocumentsQuery): Promise>; countWithProof(query: wasm.DocumentsQuery): Promise>>; sum(query: wasm.DocumentsQuery, sumProperty: string): Promise>; sumWithProof(query: wasm.DocumentsQuery, sumProperty: string): Promise>>; average(query: wasm.DocumentsQuery, averageProperty: string): Promise>; averageWithProof(query: wasm.DocumentsQuery, averageProperty: string): Promise>>; /** * Rank groups by an aggregate and return the top (or bottom) `limit` of * them. Requires protocol version 14 and a contract index declaring the * matching ranked keyword. */ ranked(query: wasm.DocumentsRankedQuery): Promise; rankedWithProof(query: wasm.DocumentsRankedQuery): Promise>; /** * Return the groups whose aggregate falls inside a bound. Same ranked * indexes as {@link ranked}, bounded by value rather than by position. */ having(query: wasm.DocumentsHavingQuery): Promise; havingWithProof(query: wasm.DocumentsHavingQuery): Promise>; }