Usage

Validate a configuration in an app-development tool.

This type is used by 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);

Type declaration

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

Members 19

NameTypeRequiredDescription
namestringYes—
versionstringYes—
buildNumbernumberYes—
iconIconSourceYes—
orientationOrientationYes—
colorSchemeColorSchemeYes—
backgroundColorstringYes—
statusBar{ style: StatusBarStyle; hidden: boolean;}Yes—
urlSchemesstring[]Yes—
linkDomainsstring[]Yes—
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;}Yes—
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>;}Yes—
permissionsKuitoPermissionsYes—
backgroundTasksstring[]Yes—
fontsFontSource[]Yes—
splashSplashConfigYes—
updates{ url: string; publicKey: string;}YesThe URL without a trailing slash.
strictbooleanYes—
migrationsstring[][]YesEach migration's statements.
statusBar — nested fields

statusBar fields

NameTypeRequiredDescription
styleStatusBarStyleYes—
hiddenbooleanYes—
ios — nested fields

ios fields

NameTypeRequiredDescription
bundleIdentifierstringYes—
icon{ light: IconSource | null; dark: IconSource | null; tinted: IconSource | null;}Yes—
supportsTabletbooleanYes—
requiresFullScreenbooleanYes—
deploymentTargetstringYes—
teamIdstringYes—
associatedDomainsstring[]Yes—
pushEnvironment"development" | "production"Yes—
backgroundModes("location" | "audio" | "voip" | "fetch" | "remote-notification" | "processing" | "external-accessory" | "bluetooth-central" | "bluetooth-peripheral" | "nearby-interaction" | "push-to-talk")[]Yes—
infoPlistPlistDictionaryYes—
entitlementsPlistDictionaryYes—
icon — nested fields

icon fields

NameTypeRequiredDescription
lightIconSourceYes—
darkIconSourceYes—
tintedIconSourceYes—
android — nested fields

android fields

NameTypeRequiredDescription
applicationIdstringYes—
adaptiveIcon{ foreground: IconSource | null; background: string | IconSource | null; monochrome: IconSource | null;}Yes—
softInputModeSoftInputModeYes—
minSdknumberYes—
signing{ keystore: string | null; keyAlias: string | null;}YesThe keystore as the config wrote it, relative to its file.
manifestAndroidManifestAdditionsYes—
themeRecord<string, string>Yes—
adaptiveIcon — nested fields

adaptiveIcon fields

NameTypeRequiredDescription
foregroundIconSourceYes—
backgroundstring | IconSourceYesA #RRGGBB color or an image.
monochromeIconSourceYes—
signing — nested fields

signing fields

NameTypeRequiredDescription
keystorestringYes—
keyAliasstringYes—
updates — nested fields

updates fields

NameTypeRequiredDescription
urlstringYes—
publicKeystringYes—
Generated from the public TypeScript declarations: signatures, props and defaults come from the checked source, descriptions from its JSDoc. No defaults are invented.