UNPKG

react-native-bootsplash

Version:

Display a bootsplash on your app starts. Hide it when you want.

193 lines 5.75 kB
import * as Expo from "@expo/config-plugins"; import detectIndent, { type Indent } from "detect-indent"; import type { Options as PrettierOptions } from "prettier"; import { type Sharp } from "sharp"; import { type XMLFormatterOptions } from "xml-formatter"; export declare const PACKAGE_NAME = "react-native-bootsplash"; export type BootSplashPluginConfig = { /** * Logo file path (PNG or SVG) */ logo: string; /** * Background color (in hexadecimal format) * @default "#fff" */ background?: string; /** * Logo width at @1x (in dp - we recommend approximately ~100) * @default 100 */ logoWidth?: number; /** * Assets output directory path * @default "assets/bootsplash" */ assetsOutput?: string; /** * License key to enable brand and dark mode assets generation * @deprecated Passing `licenseKey` directly in plugin config is deprecated as it could be leaked by `expo-constants`. Use the `BOOTSPLASH_LICENSE_KEY` environment variable instead. */ licenseKey?: string; /** * Brand file path (PNG or SVG) */ brand?: string; /** * Brand width at @1x (in dp - we recommend approximately ~80) * @default 80 */ brandWidth?: number; /** * [dark mode] Background color (in hexadecimal format) */ darkBackground?: string; /** * [dark mode] Logo file path (PNG or SVG) */ darkLogo?: string; /** * [dark mode] Brand file path (PNG or SVG) */ darkBrand?: string; android?: { /** * Enforce system bars style */ darkContentBarsStyle?: boolean; }; }; type LoggerMode = { type: "plugin"; } | { type: "cli"; cwd: string; }; export declare const setLoggerMode: (value: LoggerMode) => void; export declare const log: { warn: (text: string) => void; error: (text: string) => void; title: (emoji: string, text: string) => void; write: (filePath: string, dimensions?: { width: number; height: number; }) => void; }; export declare const hfs: { buffer: (path: string) => NonSharedBuffer; exists: (path: string) => boolean; json: (path: string) => unknown; readDir: (path: string) => string[]; realPath: (path: string) => string; rm: (path: string) => void; text: (path: string) => string; ensureDir: (dir: string) => void; write: (path: string, content: string) => void; }; export declare const writeJson: (filePath: string, content: object) => void; type FormatOptions = { indent?: Indent; } & ({ formatter: "prettier"; selfClosingTags?: boolean; useCssPlugin?: boolean; htmlWhitespaceSensitivity?: PrettierOptions["htmlWhitespaceSensitivity"]; singleAttributePerLine?: PrettierOptions["singleAttributePerLine"]; } | { formatter: "xmlFormatter"; whiteSpaceAtEndOfSelfclosingTag?: XMLFormatterOptions["whiteSpaceAtEndOfSelfclosingTag"]; }); export declare const readXmlLike: (filePath: string) => { root: import("node-html-parser").HTMLElement; formatOptions: { indent: detectIndent.Indent; }; }; export declare const writeXmlLike: (filePath: string, content: string, { indent, ...formatOptions }: FormatOptions) => Promise<void>; export type Asset = { path: string; image: Sharp; hash: string; height: number; width: number; }; export declare const transformProps: (rootPath: string, { android, licenseKey, ...rawProps }: BootSplashPluginConfig) => Promise<{ android: { /** * Enforce system bars style */ darkContentBarsStyle?: boolean; }; assetsOutputPath: string; licenseKey: string | undefined; executeAddon: boolean; background: { hex: string; rgb: { R: string; G: string; B: string; }; }; darkBackground: { hex: string; rgb: { R: string; G: string; B: string; }; } | undefined; logo: Asset; darkLogo: Asset | undefined; brand: Asset | undefined; darkBrand: Asset | undefined; logoSizeExceeded: boolean; brandSizeExceeded: boolean; fileNameSuffix: string; }>; export type Props = Awaited<ReturnType<typeof transformProps>>; export declare const writeAndroidAssets: ({ androidOutputPath, props, }: { androidOutputPath: string; props: Props; }) => Promise<void>; export declare const writeIOSAssets: ({ iosOutputPath, props, }: { iosOutputPath: string; props: Props; }) => Promise<void>; export declare const writeWebAssets: ({ htmlTemplatePath, props, }: { htmlTemplatePath: string; props: Props; }) => Promise<void>; export declare const writeGenericAssets: ({ props }: { props: Props; }) => Promise<void>; export type AddonConfig = { props: Props; androidOutputPath: string | undefined; iosOutputPath: string | undefined; htmlTemplatePath: string | undefined; }; export declare const requireAddon: ({ executeAddon, licenseKey, }: Props) => { execute: (config: AddonConfig) => Promise<void>; writeAndroidAssets: (_: { androidOutputPath: string; props: Props; }) => Promise<void>; writeIOSAssets: (_: { iosOutputPath: string; props: Props; }) => Promise<void>; writeWebAssets: (_: { htmlTemplatePath: string; props: Props; }) => Promise<void>; writeGenericAssets: (_: { props: Props; }) => Promise<void>; withAndroidColorsNight: (_: { config: Expo.ExportedConfigWithProps; props: Props; }) => Promise<Expo.ExportedConfigWithProps>; } | undefined; export {}; //# sourceMappingURL=utils.d.ts.map