import type { Prettify } from "../lib/src/common/types"; import type { LiveSyncCore } from "../main"; export type OverridableFunctionsKeys = { [K in keyof T as K extends `$${string}` ? K : never]: T[K]; }; export type ChainableExecuteFunction = { [K in keyof T as K extends `$${string}` ? T[K] extends (...args: any) => ChainableFunctionResult ? K : never : never]: T[K]; }; export type ICoreModuleBase = OverridableFunctionsKeys; export type ICoreModule = Prettify>; export type CoreModuleKeys = keyof ICoreModule; export type ChainableFunctionResult = | Promise | Promise | Promise | Promise; export type ChainableFunctionResultOrAll = Promise; type AllExecuteFunction = { [K in keyof T as K extends `$all${string}` ? T[K] extends (...args: any[]) => ChainableFunctionResultOrAll ? K : never : never]: T[K]; }; type EveryExecuteFunction = { [K in keyof T as K extends `$every${string}` ? T[K] extends (...args: any[]) => ChainableFunctionResult ? K : never : never]: T[K]; }; type AnyExecuteFunction = { [K in keyof T as K extends `$any${string}` ? T[K] extends (...args: any[]) => ChainableFunctionResult ? K : never : never]: T[K]; }; type InjectableFunction = { [K in keyof T as K extends `$$${string}` ? (T[K] extends (...args: any[]) => any ? K : never) : never]: T[K]; }; export type AllExecuteProps = AllExecuteFunction; export type EveryExecuteProps = EveryExecuteFunction; export type AnyExecuteProps = AnyExecuteFunction; export type AllInjectableProps = InjectableFunction;