import type { ExtractDefinitions, ModuleTypeSystem } from '../common/types'; /** * ADDING NEW MODULES * 0) Choose an appropriate simple kebab-case name for your module. Ideally just a single word. * This name will be used by developers to initialise your module. * ie: component("biometrics"), or flow("idv") * * 1) Define the module * 1.0) Create a folder with the same name as the module {module} * 1.1) In the file "{module}/definition.ts", create create a type definition "{module}Module" for your module using the type "ModuleDefinition", * where you will provide the chosen name, among other options. * 1.2) Define the initialisation function for your module and pass it to the "defineModule" function, along with the "ModuleDefinition" type parameter. * That function will add additional commmon functionality and enforce typing. Export the result of that function as the default export of the file. * * PS) The "defineModule" function will also "Brand" the initialise function with the ModuleDefinition, so the function will always carry the ModuleDefinition type with it, which can be retrieved with ExtractDefinition * * @example Example of a module definition * export default defineModule("module-name", (globalState, customOptions) => { * // Do module things here * // Return the module context object * return { ... } * }); * * 2) Add it to the global Modules configuration * Across the entire OneSDK, for the module name to be recognised as a valid and instantiable module, it needs to be part of the OneSDK modules type system. * The "ModuleDefinition" for each module can be extracted from the dictionary "ConfiguredModules" * The type system uses the "ConfiguredModules" to categorise and extract all sorts of particularities for each module. Interpreting them and making a summary available throughout the SDK from a single type called "Modules". * 2.1) Import the initialise function and add it to the Modules object below. * * TLDR: * - Define the module and add it to the global configuration below. * - The type "Modules" works as a global namespace for all types inferred from all the modules included in the dictionary. */ declare const Modules: { business: import("../common/types").BrandedInitialiseFunction; biometrics: import("../common/types").BrandedInitialiseFunction; device: import("../common/types").BrandedInitialiseFunction; ocr: import("../common/types").BrandedInitialiseFunction; individual: import("../common/types").BrandedInitialiseFunction; session: import("../common/types").BrandedInitialiseFunction; federation: import("../common/types").BrandedInitialiseFunction; idv: import("../common/types").BrandedInitialiseFunction; form: import("../common/types").BrandedInitialiseFunction; workflow: import("../common/types").BrandedInitialiseFunction; 'digital-id': import("../common/types").BrandedInitialiseFunction; }; export type ConfiguredModules = ExtractDefinitions; export type Modules = ModuleTypeSystem; /** * Helper function to retrieve the initialise function for a module */ export declare const getInitialiser: (name: Name) => { business: import("../common/types").BrandedInitialiseFunction; biometrics: import("../common/types").BrandedInitialiseFunction; device: import("../common/types").BrandedInitialiseFunction; ocr: import("../common/types").BrandedInitialiseFunction; individual: import("../common/types").BrandedInitialiseFunction; session: import("../common/types").BrandedInitialiseFunction; federation: import("../common/types").BrandedInitialiseFunction; idv: import("../common/types").BrandedInitialiseFunction; form: import("../common/types").BrandedInitialiseFunction; workflow: import("../common/types").BrandedInitialiseFunction; 'digital-id': import("../common/types").BrandedInitialiseFunction; }[Name]; export {}; //# sourceMappingURL=modules.d.ts.map