/** @hidden */ /** */ import GlobalConfig from './global_config'; import Base from './models/base'; import Session from './models/session'; import Cursor from './models/cursor'; import Viewport from './viewport'; import SettingsButton from './settings_button'; import UndoRedo from './undo_redo'; import { AirtableInterface, BlockRunContext } 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; } /** * We document this manually. * * @hidden */ export default class BlockSdk { /** * This value is used by the blocks-testing library to verify * compatibility. * * @hidden */ static VERSION: any; /** 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; /** * 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; /** @hidden */ constructor(airtableInterface: AirtableInterface); /** * 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; /** @hidden */ unstable_fetchAsync(requestJson: RequestJson): Promise; /** @hidden */ getBlockRunContext(): BlockRunContext; } //# sourceMappingURL=sdk.d.ts.map