Verwendung

Validate a configuration in an app-development tool.

Dieser Typ wird verwendet von 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);

Typdeklaration

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[][];
}

Mitglieder 19

NameTypErforderlichBeschreibung
namestringJa—
versionstringJa—
buildNumbernumberJa—
iconIconSourceJa—
orientationOrientationJa—
colorSchemeColorSchemeJa—
backgroundColorstringJa—
statusBar{ style: StatusBarStyle; hidden: boolean;}Ja—
urlSchemesstring[]Ja—
linkDomainsstring[]Ja—
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;}Ja—
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>;}Ja—
permissionsKuitoPermissionsJa—
backgroundTasksstring[]Ja—
fontsFontSource[]Ja—
splashSplashConfigJa—
updates{ url: string; publicKey: string;}JaThe URL without a trailing slash.
strictbooleanJa—
migrationsstring[][]JaEach migration's statements.
statusBar — verschachtelte Felder

statusBar Felder

NameTypErforderlichBeschreibung
styleStatusBarStyleJa—
hiddenbooleanJa—
ios — verschachtelte Felder

ios Felder

NameTypErforderlichBeschreibung
bundleIdentifierstringJa—
icon{ light: IconSource | null; dark: IconSource | null; tinted: IconSource | null;}Ja—
supportsTabletbooleanJa—
requiresFullScreenbooleanJa—
deploymentTargetstringJa—
teamIdstringJa—
associatedDomainsstring[]Ja—
pushEnvironment"development" | "production"Ja—
backgroundModes("location" | "audio" | "voip" | "fetch" | "remote-notification" | "processing" | "external-accessory" | "bluetooth-central" | "bluetooth-peripheral" | "nearby-interaction" | "push-to-talk")[]Ja—
infoPlistPlistDictionaryJa—
entitlementsPlistDictionaryJa—
icon — verschachtelte Felder

icon Felder

NameTypErforderlichBeschreibung
lightIconSourceJa—
darkIconSourceJa—
tintedIconSourceJa—
android — verschachtelte Felder

android Felder

NameTypErforderlichBeschreibung
applicationIdstringJa—
adaptiveIcon{ foreground: IconSource | null; background: string | IconSource | null; monochrome: IconSource | null;}Ja—
softInputModeSoftInputModeJa—
minSdknumberJa—
signing{ keystore: string | null; keyAlias: string | null;}JaThe keystore as the config wrote it, relative to its file.
manifestAndroidManifestAdditionsJa—
themeRecord<string, string>Ja—
adaptiveIcon — verschachtelte Felder

adaptiveIcon Felder

NameTypErforderlichBeschreibung
foregroundIconSourceJa—
backgroundstring | IconSourceJaA #RRGGBB color or an image.
monochromeIconSourceJa—
signing — verschachtelte Felder

signing Felder

NameTypErforderlichBeschreibung
keystorestringJa—
keyAliasstringJa—
updates — verschachtelte Felder

updates Felder

NameTypErforderlichBeschreibung
urlstringJa—
publicKeystringJa—
Generiert aus den öffentlichen TypeScript-Deklarationen: Signaturen, Props und Standardwerte stammen aus der geprüften Quelle, Beschreibungen aus deren JSDoc. Kein Standardwert ist erfunden.