import { MutateStoragePayload } from "./block_storage.js"; import { AuthorMarker, BlockOutputsBase, BlockStateV3, NavigationState, ResultOrError, ValueWithUTag, ValueWithUTagAndAuthor } from "@milaboratories/pl-model-common"; import { Operation } from "fast-json-patch"; /** Defines methods to read and write current block data. */ export interface BlockApiV3<_Data = unknown, _Args = unknown, Outputs extends BlockOutputsBase = BlockOutputsBase, Href extends `/${string}` = `/${string}`> { /** * Use this method to retrieve block state during UI initialization. Then use * {@link onStateUpdates} method to subscribe for updates. * */ loadBlockState(): Promise>>>; /** * Get all json patches (rfc6902) that were applied to the block state. * */ getPatches(uTag: string): Promise>>; /** * Mutates block storage with the given operation. * * This method returns when the data is safely saved so in case the window is * closed there will be no information losses. This function under the hood * may delay actual persistence of the supplied values. * */ mutateStorage(payload: MutateStoragePayload, author?: AuthorMarker): Promise>; /** * Sets block navigation state. * */ setNavigationState(state: NavigationState): Promise>; /** * Opens another block of the same project in the app, as selecting it in the project does. * Resolves once the app has accepted the request, which may hide this block's UI; an error * result when the project has no block with this id. * * Absent in app versions that cannot open blocks on a block's request: check for it before * offering the user to open a block. * */ openBlock?(blockId: string): Promise>; /** * Disposes the block API. * */ dispose(): Promise>; } //# sourceMappingURL=block_api_v3.d.ts.map