|
| 1 | +import type { PluginConfig } from "../types.js"; |
| 2 | + |
| 3 | +export async function promptExperimentalSettingsEntry(params: { |
| 4 | + initialConfig: PluginConfig; |
| 5 | + promptExperimentalSettingsMenu: (args: { |
| 6 | + initialConfig: PluginConfig; |
| 7 | + isInteractive: () => boolean; |
| 8 | + ui: ReturnType<typeof import("../ui/runtime.js").getUiRuntimeOptions>; |
| 9 | + cloneBackendPluginConfig: (config: PluginConfig) => PluginConfig; |
| 10 | + select: <T>( |
| 11 | + items: Array<Record<string, unknown>>, |
| 12 | + options: Record<string, unknown>, |
| 13 | + ) => Promise<T | null>; |
| 14 | + getExperimentalSelectOptions: ( |
| 15 | + ui: ReturnType<typeof import("../ui/runtime.js").getUiRuntimeOptions>, |
| 16 | + help: string, |
| 17 | + hotkeyMapper: (raw: string) => unknown, |
| 18 | + ) => Record<string, unknown>; |
| 19 | + mapExperimentalMenuHotkey: (raw: string) => unknown; |
| 20 | + mapExperimentalStatusHotkey: (raw: string) => unknown; |
| 21 | + formatDashboardSettingState: (enabled: boolean) => string; |
| 22 | + copy: Record<string, string>; |
| 23 | + input: NodeJS.ReadStream; |
| 24 | + output: NodeJS.WriteStream; |
| 25 | + runNamedBackupExport: (args: { |
| 26 | + name: string; |
| 27 | + }) => Promise<{ kind: string; path?: string; error?: unknown }>; |
| 28 | + loadAccounts: () => Promise<unknown>; |
| 29 | + loadExperimentalSyncTarget: () => Promise<unknown>; |
| 30 | + planOcChatgptSync: (args: Record<string, unknown>) => Promise<unknown>; |
| 31 | + applyOcChatgptSync: (args: Record<string, unknown>) => Promise<unknown>; |
| 32 | + getTargetKind: (targetState: unknown) => string; |
| 33 | + getTargetDestination: (targetState: unknown) => unknown; |
| 34 | + getTargetDetection: (targetState: unknown) => unknown; |
| 35 | + getTargetErrorMessage: (targetState: unknown) => string | null; |
| 36 | + getPlanKind: (plan: unknown) => string; |
| 37 | + getPlanBlockedReason: (plan: unknown) => string; |
| 38 | + getPlanPreview: (plan: unknown) => { |
| 39 | + toAdd: unknown[]; |
| 40 | + toUpdate: unknown[]; |
| 41 | + toSkip: unknown[]; |
| 42 | + unchangedDestinationOnly: unknown[]; |
| 43 | + activeSelectionBehavior: string; |
| 44 | + }; |
| 45 | + getAppliedLabel: (applied: unknown) => { label: string; color: string }; |
| 46 | + }) => Promise<PluginConfig | null>; |
| 47 | + isInteractive: () => boolean; |
| 48 | + ui: ReturnType<typeof import("../ui/runtime.js").getUiRuntimeOptions>; |
| 49 | + cloneBackendPluginConfig: (config: PluginConfig) => PluginConfig; |
| 50 | + select: <T>( |
| 51 | + items: Array<Record<string, unknown>>, |
| 52 | + options: Record<string, unknown>, |
| 53 | + ) => Promise<T | null>; |
| 54 | + getExperimentalSelectOptions: ( |
| 55 | + ui: ReturnType<typeof import("../ui/runtime.js").getUiRuntimeOptions>, |
| 56 | + help: string, |
| 57 | + hotkeyMapper: (raw: string) => unknown, |
| 58 | + ) => Record<string, unknown>; |
| 59 | + mapExperimentalMenuHotkey: (raw: string) => unknown; |
| 60 | + mapExperimentalStatusHotkey: (raw: string) => unknown; |
| 61 | + formatDashboardSettingState: (enabled: boolean) => string; |
| 62 | + copy: Record<string, string>; |
| 63 | + input: NodeJS.ReadStream; |
| 64 | + output: NodeJS.WriteStream; |
| 65 | + runNamedBackupExport: (args: { |
| 66 | + name: string; |
| 67 | + }) => Promise<{ kind: string; path?: string; error?: unknown }>; |
| 68 | + loadAccounts: () => Promise<unknown>; |
| 69 | + loadExperimentalSyncTarget: () => Promise<unknown>; |
| 70 | + planOcChatgptSync: (args: Record<string, unknown>) => Promise<unknown>; |
| 71 | + applyOcChatgptSync: (args: Record<string, unknown>) => Promise<unknown>; |
| 72 | + getTargetKind: (targetState: unknown) => string; |
| 73 | + getTargetDestination: (targetState: unknown) => unknown; |
| 74 | + getTargetDetection: (targetState: unknown) => unknown; |
| 75 | + getTargetErrorMessage: (targetState: unknown) => string | null; |
| 76 | + getPlanKind: (plan: unknown) => string; |
| 77 | + getPlanBlockedReason: (plan: unknown) => string; |
| 78 | + getPlanPreview: (plan: unknown) => { |
| 79 | + toAdd: unknown[]; |
| 80 | + toUpdate: unknown[]; |
| 81 | + toSkip: unknown[]; |
| 82 | + unchangedDestinationOnly: unknown[]; |
| 83 | + activeSelectionBehavior: string; |
| 84 | + }; |
| 85 | + getAppliedLabel: (applied: unknown) => { label: string; color: string }; |
| 86 | +}): Promise<PluginConfig | null> { |
| 87 | + return params.promptExperimentalSettingsMenu({ |
| 88 | + initialConfig: params.initialConfig, |
| 89 | + isInteractive: params.isInteractive, |
| 90 | + ui: params.ui, |
| 91 | + cloneBackendPluginConfig: params.cloneBackendPluginConfig, |
| 92 | + select: params.select, |
| 93 | + getExperimentalSelectOptions: params.getExperimentalSelectOptions, |
| 94 | + mapExperimentalMenuHotkey: params.mapExperimentalMenuHotkey, |
| 95 | + mapExperimentalStatusHotkey: params.mapExperimentalStatusHotkey, |
| 96 | + formatDashboardSettingState: params.formatDashboardSettingState, |
| 97 | + copy: params.copy, |
| 98 | + input: params.input, |
| 99 | + output: params.output, |
| 100 | + runNamedBackupExport: params.runNamedBackupExport, |
| 101 | + loadAccounts: params.loadAccounts, |
| 102 | + loadExperimentalSyncTarget: params.loadExperimentalSyncTarget, |
| 103 | + planOcChatgptSync: params.planOcChatgptSync, |
| 104 | + applyOcChatgptSync: params.applyOcChatgptSync, |
| 105 | + getTargetKind: params.getTargetKind, |
| 106 | + getTargetDestination: params.getTargetDestination, |
| 107 | + getTargetDetection: params.getTargetDetection, |
| 108 | + getTargetErrorMessage: params.getTargetErrorMessage, |
| 109 | + getPlanKind: params.getPlanKind, |
| 110 | + getPlanBlockedReason: params.getPlanBlockedReason, |
| 111 | + getPlanPreview: params.getPlanPreview, |
| 112 | + getAppliedLabel: params.getAppliedLabel, |
| 113 | + }); |
| 114 | +} |
0 commit comments