import * as v from "valibot"; import type { CustomBlockUpdatePageErrorInfo } from "../messages/updatePageResult.js"; import type { NotionPage, NotionPageCover, NotionPageIcon, NotionPageId, NotionPagePropertyInputMap } from "../pages/page.js"; import { type NotionDataSourceValue } from "./dataSourceValue.js"; /** * Bridge shape for a data source page, as parsed from inbound host messages. The host keys * properties by raw property ID. The four built-ins (`created_time`, `last_edited_time`, * `created_by`, `last_edited_by`) are normally present, possibly with `undefined` values. * * Internal to the SDK. The consumer-facing shape is {@link NotionDataSourcePage}. */ export declare const notionDataSourcePageBridgeSchema: v.ObjectSchema<{ readonly id: v.CustomSchema | undefined>; readonly propertiesById: v.RecordSchema, v.OptionalSchema, v.NumberSchema, v.BooleanSchema, v.VariantSchema<"type", [v.ObjectSchema<{ readonly type: v.LiteralSchema<"date", undefined>; readonly start_date: v.StringSchema; readonly reminder: v.OptionalSchema; readonly value: v.NumberSchema; readonly time: v.StringSchema; readonly defaultTimeZone: v.OptionalSchema, undefined>; }, undefined>, v.ObjectSchema<{ readonly unit: v.LiteralSchema<"none", undefined>; }, undefined>], undefined>, undefined>; }, undefined>, v.ObjectSchema<{ readonly type: v.LiteralSchema<"daterange", undefined>; readonly start_date: v.StringSchema; readonly end_date: v.StringSchema; readonly reminder: v.OptionalSchema; readonly value: v.NumberSchema; readonly time: v.StringSchema; readonly defaultTimeZone: v.OptionalSchema, undefined>; }, undefined>, v.ObjectSchema<{ readonly unit: v.LiteralSchema<"none", undefined>; }, undefined>], undefined>, undefined>; }, undefined>, v.ObjectSchema<{ readonly type: v.LiteralSchema<"datetime", undefined>; readonly start_date: v.StringSchema; readonly start_time: v.StringSchema; readonly time_zone: v.OptionalSchema, undefined>; readonly reminder: v.OptionalSchema; readonly value: v.NumberSchema; readonly time: v.StringSchema; readonly defaultTimeZone: v.OptionalSchema, undefined>; }, undefined>, v.ObjectSchema<{ readonly unit: v.PicklistSchema<["hour", "minute"], undefined>; readonly value: v.NumberSchema; }, undefined>], undefined>, v.ObjectSchema<{ readonly unit: v.LiteralSchema<"none", undefined>; }, undefined>], undefined>, undefined>; }, undefined>, v.ObjectSchema<{ readonly type: v.LiteralSchema<"datetimerange", undefined>; readonly start_date: v.StringSchema; readonly start_time: v.StringSchema; readonly end_date: v.StringSchema; readonly end_time: v.StringSchema; readonly time_zone: v.OptionalSchema, undefined>; readonly reminder: v.OptionalSchema; readonly value: v.NumberSchema; readonly time: v.StringSchema; readonly defaultTimeZone: v.OptionalSchema, undefined>; }, undefined>, v.ObjectSchema<{ readonly unit: v.PicklistSchema<["hour", "minute"], undefined>; readonly value: v.NumberSchema; }, undefined>], undefined>, v.ObjectSchema<{ readonly unit: v.LiteralSchema<"none", undefined>; }, undefined>], undefined>, undefined>; }, undefined>], undefined>, v.ArraySchema, undefined>, v.ArraySchema; readonly table: v.StringSchema; }, undefined>, undefined>], undefined>, undefined>, undefined>; }, undefined>; /** Internal SDK type for a parsed bridge page. */ export type NotionDataSourcePageBridge = v.InferOutput; export type NotionDataSourcePageUpdateInput = { properties?: NotionPagePropertyInputMap; icon?: NotionPageIcon; cover?: NotionPageCover; archived?: boolean; }; export type NotionDataSourcePageUpdateResult = { status: "success"; page: NotionPage; } | { status: "error"; error: CustomBlockUpdatePageErrorInfo; }; /** * Consumer-facing page shape returned from {@link useDataSource}. Derived from the bridge payload * plus the data source's `propertyIdsByKey`. */ export type NotionDataSourcePage = { id: NotionPageId; /** * Keyed mapping of raw property IDs to their value. Includes all properties on the data source, * including the four built-ins (`created_time`, `last_edited_time`, `created_by`, * `last_edited_by`). */ propertiesById: { [propertyId: string]: NotionDataSourceValue | undefined; }; /** * Keyed mapping of user-defined keys to their value. Only includes properties that are mapped * to a raw property ID in the data source's `propertyIdsByKey`. */ propertiesByKey: { [key: string]: NotionDataSourceValue | undefined; }; /** * Updates this page using the data source's property-key bindings. The SDK resolves property * keys to raw property IDs before sending the bridge message to the host. */ update: (input: NotionDataSourcePageUpdateInput) => Promise; }; //# sourceMappingURL=dataSourcePage.d.ts.map