Utilisation

Validate a configuration in an app-development tool.

Ce type est utilisé par config.resolveConfig

tsx
// Validate a configuration in an app-development tool.
import { resolveConfig, SETTING_DEFAULTS, IOS_BACKGROUND_MODES } from 'kuito/config';

const config = resolveConfig(
  {
    name: 'Notes',
    ios: { bundleIdentifier: 'com.example.notes' },
    android: { applicationId: 'com.example.notes' },
    environments: { staging: { idSuffix: '.staging' } },
  },
  '/project/kuito.config.ts',
  'staging',
);
console.log(config.ios.bundleIdentifier, config.splash, config.icon);
console.log(SETTING_DEFAULTS.minSdk, IOS_BACKGROUND_MODES);

Déclaration du type

ts
export interface AppConfig {
  name: string;
  version: string;
  buildNumber: number;
  icon: IconSource | null;
  orientation: Orientation;
  colorScheme: ColorScheme;
  backgroundColor: string | null;
  statusBar: { style: StatusBarStyle; hidden: boolean };
  urlSchemes: string[];
  linkDomains: string[];
  ios: {
    bundleIdentifier: string;
    icon: { light: IconSource | null; dark: IconSource | null; tinted: IconSource | null };
    supportsTablet: boolean;
    requiresFullScreen: boolean;
    deploymentTarget: string;
    teamId: string | null;
    associatedDomains: string[];
    pushEnvironment: PushEnvironment | null;
    backgroundModes: IOSBackgroundMode[];
    infoPlist: PlistDictionary;
    entitlements: PlistDictionary;
  };
  android: {
    applicationId: string;
    adaptiveIcon: {
      foreground: IconSource | null;
      /** A `#RRGGBB` color or an image. */
      background: string | IconSource | null;
      monochrome: IconSource | null;
    };
    softInputMode: SoftInputMode;
    minSdk: number;
    /** The keystore as the config wrote it, relative to its file. */
    signing: { keystore: string | null; keyAlias: string | null };
    manifest: AndroidManifestAdditions;
    theme: Record<string, string>;
  };
  permissions: KuitoPermissions;
  backgroundTasks: string[];
  fonts: FontSource[];
  splash: SplashConfig | null;
  /** The URL without a trailing slash. */
  updates: { url: string; publicKey: string } | null;
  strict: boolean;
  /** Each migration's statements. */
  migrations: string[][];
}

Membres 19

NomTypeRequisDescription
namestringOui—
versionstringOui—
buildNumbernumberOui—
iconIconSourceOui—
orientationOrientationOui—
colorSchemeColorSchemeOui—
backgroundColorstringOui—
statusBar{ style: StatusBarStyle; hidden: boolean;}Oui—
urlSchemesstring[]Oui—
linkDomainsstring[]Oui—
ios{ bundleIdentifier: string; icon: { light: IconSource | null; dark: IconSource | null; tinted: IconSource | null; }; supportsTablet: boolean; requiresFullScreen: boolean; deploymentTarget: string; teamId: string | null; associatedDomains: string[]; pushEnvironment: PushEnvironment | null; backgroundModes: IOSBackgroundMode[]; infoPlist: PlistDictionary; entitlements: PlistDictionary;}Oui—
android{ applicationId: string; adaptiveIcon: { foreground: IconSource | null; background: string | IconSource | null; monochrome: IconSource | null; }; softInputMode: SoftInputMode; minSdk: number; signing: { keystore: string | null; keyAlias: string | null; }; manifest: AndroidManifestAdditions; theme: Record<string, string>;}Oui—
permissionsKuitoPermissionsOui—
backgroundTasksstring[]Oui—
fontsFontSource[]Oui—
splashSplashConfigOui—
updates{ url: string; publicKey: string;}OuiThe URL without a trailing slash.
strictbooleanOui—
migrationsstring[][]OuiEach migration's statements.
statusBar — champs imbriqués

statusBar champs

NomTypeRequisDescription
styleStatusBarStyleOui—
hiddenbooleanOui—
ios — champs imbriqués

ios champs

NomTypeRequisDescription
bundleIdentifierstringOui—
icon{ light: IconSource | null; dark: IconSource | null; tinted: IconSource | null;}Oui—
supportsTabletbooleanOui—
requiresFullScreenbooleanOui—
deploymentTargetstringOui—
teamIdstringOui—
associatedDomainsstring[]Oui—
pushEnvironment"development" | "production"Oui—
backgroundModes("location" | "audio" | "voip" | "fetch" | "remote-notification" | "processing" | "external-accessory" | "bluetooth-central" | "bluetooth-peripheral" | "nearby-interaction" | "push-to-talk")[]Oui—
infoPlistPlistDictionaryOui—
entitlementsPlistDictionaryOui—
icon — champs imbriqués

icon champs

NomTypeRequisDescription
lightIconSourceOui—
darkIconSourceOui—
tintedIconSourceOui—
android — champs imbriqués

android champs

NomTypeRequisDescription
applicationIdstringOui—
adaptiveIcon{ foreground: IconSource | null; background: string | IconSource | null; monochrome: IconSource | null;}Oui—
softInputModeSoftInputModeOui—
minSdknumberOui—
signing{ keystore: string | null; keyAlias: string | null;}OuiThe keystore as the config wrote it, relative to its file.
manifestAndroidManifestAdditionsOui—
themeRecord<string, string>Oui—
adaptiveIcon — champs imbriqués

adaptiveIcon champs

NomTypeRequisDescription
foregroundIconSourceOui—
backgroundstring | IconSourceOuiA #RRGGBB color or an image.
monochromeIconSourceOui—
signing — champs imbriqués

signing champs

NomTypeRequisDescription
keystorestringOui—
keyAliasstringOui—
updates — champs imbriqués

updates champs

NomTypeRequisDescription
urlstringOui—
publicKeystringOui—
Généré depuis les déclarations TypeScript publiques : signatures, props et valeurs par défaut viennent de la source vérifiée, les descriptions de sa JSDoc. Aucune valeur par défaut n'est inventée.