import type { DashboardDefaultsDefinition, DashboardJSON, MiddlewareContext, PresetMap, RootVisualizationsDefinition } from '@splunk/dashboard-types'; export interface DeprecatedVisualization { id: string; type: string; } export type MigrationStatus = [ TSuccess ] extends [true] ? { success: TSuccess; definition: TDefinition; skipped?: boolean; } : { success: TSuccess; definition: TDefinition; reason?: string; }; /** * A signature for methods which migrates from one definition structure to another. * * Upon **success** the implementation must return: * ```js * { * success: true, * definition: MigratedDefinition, * } * ``` * * Upon **failure** the implementation must return (`reason` is optional): * ```js * { * success: false, * definition: OriginalDefinition, * reason?: string, * } * ``` * --- * @template FDefinition The type of the original "from" definition. Defaults to `DashboardJSON` * @template TDefinition The type of the target "to" definition. Defaults to `FDefinition` * @param {FDefinition} arg0.definition The definition to be migrated */ export type CrossVersionMigrationFn = ({ definition, }: { definition: FDefinition | TDefinition; }) => MigrationStatus | MigrationStatus; /** * A utility which migrates from `FDefinition` to `TDefinition` with access to the middleware context * @see {@link CrossVersionMigrationFn} */ export type MiddlewareCrossVersionMigrationFn = ({ definition, context, }: { definition: FDefinition | TDefinition; context: MiddlewareContext; }) => MigrationStatus | MigrationStatus; type MigrateUtilityCallSig = ({ definition, preset, }: { definition: TDefinition; preset: TPreset; }) => TDefinition; export type MigrateDefaultsCallSig = MigrateUtilityCallSig; export type MigrateVisualizationsCallSig = MigrateUtilityCallSig; export type MigrateDashboardDefinitionCallSig = MigrateUtilityCallSig; export {}; //# sourceMappingURL=types.d.ts.map