react-native
Version:
A framework for building native apps using React
44 lines (42 loc) • 1.71 kB
TypeScript
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<20ac63d668b0607bd64c067acf2ddbcd>>
*
* This file was translated from Flow by scripts/js-api/build-types/index.js.
* Original file: packages/react-native/Libraries/ReactNative/AppRegistry.flow.js
*/
import * as React from "react";
import type { ViewStyleProp } from "../StyleSheet/StyleSheet";
import type { RootTag } from "../Types/RootTagTypes";
import type { DisplayModeType } from "./DisplayMode";
import type { IPerformanceLogger } from "./IPerformanceLogger.flow";
type HeadlessTask = (taskData: any) => Promise<void>;
export type TaskProvider = () => HeadlessTask;
export type ComponentProvider = () => React.ComponentType<any>;
export type ComponentProviderInstrumentationHook = (component_: ComponentProvider, scopedPerformanceLogger: IPerformanceLogger) => React.ComponentType<any>;
export type AppConfig = {
appKey: string;
component?: ComponentProvider | undefined;
run?: Runnable | undefined;
section?: boolean | undefined;
};
export type AppParameters = {
initialProps: Readonly<{
[$$Key$$: string]: unknown;
}>;
rootTag: RootTag;
};
export type Runnable = (appParameters: AppParameters, displayMode: DisplayModeType) => void;
export type Runnables = {
[appKey: string]: Runnable;
};
export type Registry = {
sections: ReadonlyArray<string>;
runnables: Runnables;
};
export type WrapperComponentProvider = (appParameters: Object, appKey?: string) => React.ComponentType<any>;
export type RootViewStyleProvider = (appParameters: Object) => ViewStyleProp;