UNPKG

@energica-city/shared-amplify-utils

Version:

Shared utilities for AWS Amplify projects

26 lines 1.12 kB
import { QueryFactory } from './QueryFactory'; import type { AmplifyOutputs, AmplifyModelType } from './types'; /** * Initialize queries with schema and generate query factories automatically. * * @param config Configuration object * @param config.amplifyOutputs The outputs from your Amplify backend * @param config.schema The Amplify schema definition * @param config.entities Optional array of entity names to initialize. If not provided, all entities will be initialized * @param config.clientKey A unique key for the client instance, defaults to 'default' */ export declare function initializeQueries<TSchema extends { models: Record<string, unknown>; }, TTypes extends Record<string, AmplifyModelType>>(config: { amplifyOutputs: AmplifyOutputs; schema: TSchema; entities?: (keyof TTypes & string)[]; clientKey?: string; }): Promise<{ [K in keyof TTypes]: Awaited<ReturnType<typeof QueryFactory<K & string, TTypes>>>; }>; /** * Gets the global Amplify outputs */ export declare function getGlobalAmplifyOutputs(): AmplifyOutputs | null; //# sourceMappingURL=initialize.d.ts.map