Skip to content

Commit

Permalink
[core] Make TS declaration for process an interface (#32464)
Browse files Browse the repository at this point in the history
  • Loading branch information
tsapeta authored Oct 31, 2024
1 parent 357c473 commit 63b6394
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 37 deletions.
1 change: 1 addition & 0 deletions packages/expo-modules-core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
### 💡 Others

- [android] Added helper for looking up TaskService instance used by expo-task-manager ([#32300](https://github.com/expo/expo/pull/32300) by [@chrfalch](https://github.com/chrfalch))
- Made TypeScript declaration for `process` an interface. ([#32464](https://github.com/expo/expo/pull/32464) by [@tsapeta](https://github.com/tsapeta))

## 2.0.0-preview.7 — 2024-10-29

Expand Down
33 changes: 17 additions & 16 deletions packages/expo-modules-core/build/ts-declarations/global.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 22 additions & 20 deletions packages/expo-modules-core/src/ts-declarations/global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,27 @@ type ViewConfig = {
directEventTypes: Record<string, { registrationName: string }>;
};

export interface ExpoProcess {
env: {
NODE_ENV: string;
/** Used in `@expo/metro-runtime`. */
EXPO_DEV_SERVER_ORIGIN?: string;

EXPO_ROUTER_IMPORT_MODE?: string;
EXPO_ROUTER_ABS_APP_ROOT?: string;
EXPO_ROUTER_APP_ROOT?: string;

/** Maps to the `experiments.baseUrl` property in the project Expo config. This is injected by `babel-preset-expo` and supports automatic cache invalidation. */
EXPO_BASE_URL?: string;

/** Build-time representation of the `Platform.OS` value that the current JavaScript was bundled for. Does not support platform shaking wrapped require statements. */
EXPO_OS?: string;

[key: string]: any;
};
[key: string]: any;
}

/* eslint-disable no-var */

declare global {
Expand All @@ -69,24 +90,5 @@ declare global {
*/
var expo: ExpoGlobal;

const process: {
env: {
NODE_ENV: string;
/** Used in `@expo/metro-runtime`. */
EXPO_DEV_SERVER_ORIGIN?: string;

EXPO_ROUTER_IMPORT_MODE?: string;
EXPO_ROUTER_ABS_APP_ROOT?: string;
EXPO_ROUTER_APP_ROOT?: string;

/** Maps to the `experiments.baseUrl` property in the project Expo config. This is injected by `babel-preset-expo` and supports automatic cache invalidation. */
EXPO_BASE_URL?: string;

/** Build-time representation of the `Platform.OS` value that the current JavaScript was bundled for. Does not support platform shaking wrapped require statements. */
EXPO_OS?: string;

[key: string]: any;
};
[key: string]: any;
};
var process: ExpoProcess;
}

0 comments on commit 63b6394

Please sign in to comment.