UNPKG

nitro-codegen

Version:

The code-generator for react-native-nitro-modules.

121 lines (120 loc) 4.37 kB
import { z } from 'zod'; export declare const NitroUserConfigSchema: z.ZodObject<{ /** * Represents the C++ namespace of the module that will be generated. * * This can have multiple sub-namespaces, and is always relative to `margelo::nitro`. * @example `['image']` -> `margelo::nitro::image` */ cxxNamespace: z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">; /** * iOS specific options. */ ios: z.ZodObject<{ /** * Represents the iOS module name of the module that will be generated. * * This will be used to generate Swift bridges, as those are always namespaced within the clang module. * * If you are using CocoaPods, this should be the Pod name defined in the `.podspec`. * @example `NitroImage` */ iosModuleName: z.ZodEffects<z.ZodString, string, string>; }, "strip", z.ZodTypeAny, { iosModuleName: string; }, { iosModuleName: string; }>; /** * Android specific options. */ android: z.ZodObject<{ /** * Represents the Android namespace ("package") of the module that will be generated. * * This can have multiple sub-namespaces, and is always relative to `com.margelo.nitro`. * @example `['image']` -> `com.margelo.nitro.image` */ androidNamespace: z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">; /** * Represents the name of the Android C++ library (aka name in CMakeLists.txt `add_library(..)`). * This will be loaded via `System.loadLibrary(...)`. * @example `NitroImage` */ androidCxxLibName: z.ZodEffects<z.ZodString, string, string>; }, "strip", z.ZodTypeAny, { androidNamespace: string[]; androidCxxLibName: string; }, { androidNamespace: string[]; androidCxxLibName: string; }>; /** * Configures the code that gets generated for autolinking (registering) * Hybrid Object constructors. * * Each class listed here needs to have a default constructor/initializer that takes * zero arguments. */ autolinking: z.ZodRecord<z.ZodString, z.ZodObject<{ cpp: z.ZodOptional<z.ZodString>; swift: z.ZodOptional<z.ZodString>; kotlin: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { cpp?: string | undefined; swift?: string | undefined; kotlin?: string | undefined; }, { cpp?: string | undefined; swift?: string | undefined; kotlin?: string | undefined; }>>; /** * A list of paths relative to the project directory that should be ignored by nitrogen. * Nitrogen will not look for `.nitro.ts` files in these directories. */ ignorePaths: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; /** * Configures whether all nitro-generated files are marked as * [`linguist-generated`](https://docs.github.com/en/repositories/working-with-files/managing-files/customizing-how-changed-files-appear-on-github) * for GitHub. This disables diffing for generated content and excludes them from language statistics. * This is controlled via `nitrogen/generated/.gitattributes`. */ gitAttributesGeneratedFlag: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>; }, "strip", z.ZodTypeAny, { cxxNamespace: string[]; ios: { iosModuleName: string; }; android: { androidNamespace: string[]; androidCxxLibName: string; }; autolinking: Record<string, { cpp?: string | undefined; swift?: string | undefined; kotlin?: string | undefined; }>; gitAttributesGeneratedFlag: boolean; ignorePaths?: string[] | undefined; }, { cxxNamespace: string[]; ios: { iosModuleName: string; }; android: { androidNamespace: string[]; androidCxxLibName: string; }; autolinking: Record<string, { cpp?: string | undefined; swift?: string | undefined; kotlin?: string | undefined; }>; ignorePaths?: string[] | undefined; gitAttributesGeneratedFlag?: boolean | undefined; }>; /** * Represents the structure of a `nitro.json` config file. */ export type NitroUserConfig = z.infer<typeof NitroUserConfigSchema>;