import { BlockStatePatch } from "./block_state_patch.js"; import { PluginFactoryLike, PluginHandle } from "./plugin_handle.js"; import { BlockApiV1 } from "./block_api_v1.js"; import { BlockApiV2 } from "./block_api_v2.js"; import { BlockApiV3 } from "./block_api_v3.js"; import { SdkInfo } from "./version.js"; import { PublicOutputFieldDef } from "./plugin_model.js"; import { PluginRecord } from "./block_model.js"; import { BlockCodeKnownFeatureFlags, BlockOutputsBase, BlockStateV3, DriverKit, OutputWithStatus, ServiceDispatch, UiServices as UiServices$1 } from "@milaboratories/pl-model-common"; /** Defines all methods to interact with the platform environment from within a block UI. @deprecated */ export interface PlatformaV1> = Record>, UiState = unknown, Href extends `/${string}` = `/${string}`> extends BlockApiV1, DriverKit { /** Information about SDK version current platforma environment was compiled with. */ readonly sdkInfo: SdkInfo; readonly apiVersion?: 1; } /** V2 version based on effective json patches pulling API */ export interface PlatformaV2> = Record>, UiState = unknown, Href extends `/${string}` = `/${string}`> extends BlockApiV2, DriverKit { /** Information about SDK version current platforma environment was compiled with. */ readonly sdkInfo: SdkInfo; readonly apiVersion: 2; } export interface PlatformaV3> = Record>, Href extends `/${string}` = `/${string}`, Plugins extends Record = Record, UiServices extends Partial = Partial> extends BlockApiV3, DriverKit { /** Information about SDK version current platforma environment was compiled with. */ readonly sdkInfo: SdkInfo; readonly apiVersion: 3; /** Service dispatch — lists available services, their methods, and invokes them. */ readonly serviceDispatch: ServiceDispatch; /** @internal Type brand for plugin type inference. Not used at runtime. */ readonly __pluginsBrand?: Plugins; /** @internal Type brand for UI service type inference. Not used at runtime. */ readonly __uiServicesBrand?: UiServices; } export type Platforma> = Record>, UiStateOrData = unknown, Href extends `/${string}` = `/${string}`> = PlatformaV1 | PlatformaV2 | PlatformaV3; export type PlatformaExtended = Pl & { blockModelInfo: BlockModelInfo; }; export type BlockModelInfo = { outputs: Record; pluginIds: PluginHandle[]; featureFlags: BlockCodeKnownFeatureFlags; pluginPublicOutputs: Record>; }; export type PlatformaApiVersion = Platforma["apiVersion"]; export type InferArgsType = Pl extends Platforma ? Args : never; export type InferOutputsType = Pl extends Platforma ? Outputs : never; export type InferUiState = Pl extends Platforma>, infer UiState> ? UiState : never; export type InferDataType = Pl extends Platforma>, infer Data> ? Data : never; export type InferHrefType = Pl extends Platforma ? Href : never; export type PlatformaFactory = (config: { sdkVersion: string; }) => Platforma; export type InferBlockState = BlockStateV3, InferOutputsType, InferHrefType>; export type InferBlockStatePatch = BlockStatePatch, InferOutputsType, InferUiState, InferHrefType>; /** Extract plugin IDs as a string literal union from a Platforma type. */ export type InferPluginNames = Pl extends PlatformaV3 ? string & keyof P : never; /** Extract the Data type for a specific plugin by its ID. */ export type InferPluginData = Pl extends PlatformaV3 ? PluginId extends keyof P ? P[PluginId] extends PluginRecord ? D : never : never : never; /** * Derives the UI-facing entry map for a plugin registry. * For each plugin instance, produces a typed handle and its public outputs — * the subset of plugin state accessible to block UI without usePlugin(). */ export type InferPluginUiEntries> = { readonly [K in keyof T]: T[K] extends PluginRecord ? { handle: PluginHandle>; publicOutputs: PublicOutputs; } : never; }; //# sourceMappingURL=platforma.d.ts.map