/** @hidden */ /** */ import { ModelChange } from "./types/base"; import GlobalConfig from "./global_config"; import { GlobalConfigUpdate } from "./types/global_config"; import Base from "./models/base"; import Session from "./models/session"; import Mutations from "./models/mutations"; import Cursor from "./models/cursor"; import Viewport from "./viewport"; import SettingsButton from "./settings_button"; import UndoRedo from "./undo_redo"; import { PerformRecordAction } from "./perform_record_action"; import { AirtableInterface, AppInterface } from "./types/airtable_interface"; import { RequestJson, ResponseJson } from "./types/backend_fetch_types"; /** * @hidden * @example * ```js * import {runInfo} from '@airtable/blocks'; * if (runInfo.isFirstRun) { * // The current user just installed this block. * // Take the opportunity to show any onboarding and set * // sensible defaults if the user has permission. * // For example, if the block relies on a table, it would * // make sense to set that to cursor.activeTableId * } * ``` */ export interface RunInfo { isFirstRun: boolean; isDevelopmentMode: boolean; intentData: unknown; } /** @hidden */ declare type UpdateBatcher = (applyUpdates: () => void) => void; /** * We document this manually. * * @hidden */ export default class BlockSdk { /** * This value is used by the blocks-testing library to verify * compatibility. * * @hidden */ static VERSION: string; /** @internal */ __airtableInterface: AirtableInterface; /** Storage for this block installation's configuration. */ globalConfig: GlobalConfig; /** Represents the current Airtable {@link Base}. */ base: Base; /** Contains information about the current session. */ session: Session; /** @internal */ __mutations: Mutations; /** * Returns the ID for the current block installation. * * @example * ```js * import {installationId} from '@airtable/blocks'; * console.log(installationId); * // => 'blifDutUr92OKwnUn' * ``` */ installationId: string; /** Controls the block's viewport. You can fullscreen the block and add size * constrains using `viewport`. */ viewport: Viewport; /** @hidden */ runInfo: RunInfo; /** Returns information about the active table, active view, and selected records. */ cursor: Cursor; /** * Controls the block's {@link settingsButton settings button}. */ settingsButton: SettingsButton; /** @hidden */ undoRedo: UndoRedo; /** @internal */ performRecordAction: PerformRecordAction; /** @internal */ _runWithUpdateBatching: UpdateBatcher; /** @hidden */ constructor(airtableInterface: AirtableInterface); /** @internal */ __applyModelChanges(changes: ReadonlyArray): void; /** @internal */ __applyGlobalConfigUpdates(updates: ReadonlyArray): void; /** @internal */ _registerHandlers(): void; /** * Call this function to reload your block. * * @example * ```js * import React from 'react'; * import {reload} from '@airtable/blocks'; * import {Button, initializeBlock} from '@airtable/blocks/ui'; * function MyBlock() { * return ; * } * initializeBlock(() => ); * ``` */ reload(): void; /** @internal */ __setBatchedUpdatesFn(newUpdateBatcher: UpdateBatcher): void; /** * @internal */ get __appInterface(): AppInterface; /** @hidden */ unstable_fetchAsync(requestJson: RequestJson): Promise; } export {};