expo 55.0.0-preview.7 → 55.0.0-preview.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -32,7 +32,7 @@ buildscript {
32
32
  def reactNativeVersion = project.extensions.getByType(ExpoModuleExtension).reactNativeVersion
33
33
 
34
34
  group = 'host.exp.exponent'
35
- version = '55.0.0-preview.7'
35
+ version = '55.0.0-preview.9'
36
36
 
37
37
  expoModule {
38
38
  // We can't prebuild the module because it depends on the generated files.
@@ -43,7 +43,7 @@ android {
43
43
  namespace "expo.core"
44
44
  defaultConfig {
45
45
  versionCode 1
46
- versionName "55.0.0-preview.7"
46
+ versionName "55.0.0-preview.9"
47
47
  consumerProguardFiles("proguard-rules.pro")
48
48
  }
49
49
  testOptions {
@@ -5,8 +5,8 @@
5
5
  * This source code is licensed under the MIT license found in the
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  */
8
- import { URL, URLSearchParams } from 'whatwg-url-without-unicode';
9
- declare module 'whatwg-url-without-unicode' {
8
+ import { URL, URLSearchParams } from 'whatwg-url-minimum';
9
+ declare module 'whatwg-url-minimum' {
10
10
  type BlobLike = Blob & {
11
11
  data?: {
12
12
  blobId: string;
@@ -16,7 +16,6 @@ declare module 'whatwg-url-without-unicode' {
16
16
  interface URLConstructor {
17
17
  createObjectURL(blob: BlobLike): string;
18
18
  revokeObjectURL(url: URL): void;
19
- canParse(url: string, base?: string): boolean;
20
19
  }
21
20
  }
22
21
  export { URL, URLSearchParams };
@@ -1 +1 @@
1
- {"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../../src/winter/url.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,EAAE,GAAG,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AA+ClE,OAAO,QAAQ,4BAA4B,CAAC;IAE1C,KAAK,QAAQ,GAAG,IAAI,GAAG;QAAE,IAAI,CAAC,EAAE;YAAE,MAAM,EAAE,MAAM,CAAC;YAAC,MAAM,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,CAAC;IAErE,UAAU,cAAc;QACtB,eAAe,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,CAAC;QACxC,eAAe,CAAC,GAAG,EAAE,GAAG,GAAG,IAAI,CAAC;QAChC,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;KAC/C;CACF;AAiDD,OAAO,EAAE,GAAG,EAAE,eAAe,EAAE,CAAC"}
1
+ {"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../../src/winter/url.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,EAAE,GAAG,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AA+C1D,OAAO,QAAQ,oBAAoB,CAAC;IAElC,KAAK,QAAQ,GAAG,IAAI,GAAG;QAAE,IAAI,CAAC,EAAE;YAAE,MAAM,EAAE,MAAM,CAAC;YAAC,MAAM,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,CAAC;IAErE,UAAU,cAAc;QACtB,eAAe,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,CAAC;QACxC,eAAe,CAAC,GAAG,EAAE,GAAG,GAAG,IAAI,CAAC;KACjC;CACF;AAyCD,OAAO,EAAE,GAAG,EAAE,eAAe,EAAE,CAAC"}
@@ -1,8 +1,8 @@
1
1
  {
2
- "@expo/fingerprint": "~0.16.2",
3
- "@expo/metro-runtime": "~55.0.3",
2
+ "@expo/fingerprint": "~0.16.3",
3
+ "@expo/metro-runtime": "~55.0.4",
4
4
  "@expo/vector-icons": "^15.0.2",
5
- "@expo/ui": "~55.0.0-beta.3",
5
+ "@expo/ui": "~55.0.0-preview.4",
6
6
  "@react-native-async-storage/async-storage": "2.2.0",
7
7
  "@react-native-community/datetimepicker": "8.6.0",
8
8
  "@react-native-masked-view/masked-view": "0.3.2",
@@ -16,82 +16,82 @@
16
16
  "expo-analytics-amplitude": "~11.3.0",
17
17
  "expo-app-auth": "~11.1.0",
18
18
  "expo-app-loader-provider": "~8.0.0",
19
- "expo-apple-authentication": "~55.0.3",
20
- "expo-application": "~55.0.3",
21
- "expo-asset": "~55.0.2",
22
- "expo-audio": "~55.0.3",
19
+ "expo-apple-authentication": "~55.0.4",
20
+ "expo-application": "~55.0.4",
21
+ "expo-asset": "~55.0.3",
22
+ "expo-audio": "~55.0.4",
23
23
  "expo-auth-session": "~55.0.3",
24
- "expo-background-fetch": "~55.0.3",
25
- "expo-background-task": "~55.0.3",
26
- "expo-battery": "~55.0.3",
27
- "expo-blur": "~55.0.3",
28
- "expo-brightness": "~55.0.3",
29
- "expo-brownfield": "~55.0.4",
30
- "expo-build-properties": "~55.0.4",
31
- "expo-calendar": "~55.0.3",
32
- "expo-camera": "~55.0.3",
33
- "expo-cellular": "~55.0.3",
24
+ "expo-background-fetch": "~55.0.4",
25
+ "expo-background-task": "~55.0.4",
26
+ "expo-battery": "~55.0.4",
27
+ "expo-blur": "~55.0.4",
28
+ "expo-brightness": "~55.0.4",
29
+ "expo-brownfield": "~55.0.6",
30
+ "expo-build-properties": "~55.0.5",
31
+ "expo-calendar": "~55.0.4",
32
+ "expo-camera": "~55.0.4",
33
+ "expo-cellular": "~55.0.4",
34
34
  "expo-checkbox": "~55.0.2",
35
- "expo-clipboard": "~55.0.3",
36
- "expo-constants": "~55.0.2",
37
- "expo-contacts": "~55.0.3",
38
- "expo-crypto": "~55.0.3",
39
- "expo-dev-client": "~55.0.3",
40
- "expo-device": "~55.0.3",
41
- "expo-document-picker": "~55.0.3",
42
- "expo-file-system": "~55.0.3",
35
+ "expo-clipboard": "~55.0.4",
36
+ "expo-constants": "~55.0.3",
37
+ "expo-contacts": "~55.0.4",
38
+ "expo-crypto": "~55.0.4",
39
+ "expo-dev-client": "~55.0.4",
40
+ "expo-device": "~55.0.5",
41
+ "expo-document-picker": "~55.0.4",
42
+ "expo-file-system": "~55.0.4",
43
43
  "expo-font": "~55.0.3",
44
- "expo-gl": "~55.0.3",
45
- "expo-glass-effect": "~55.0.3",
44
+ "expo-gl": "~55.0.4",
45
+ "expo-glass-effect": "~55.0.4",
46
46
  "expo-google-app-auth": "~8.3.0",
47
- "expo-haptics": "~55.0.3",
47
+ "expo-haptics": "~55.0.4",
48
48
  "expo-image": "~55.0.3",
49
49
  "expo-image-loader": "~55.0.0",
50
- "expo-image-manipulator": "~55.0.3",
51
- "expo-image-picker": "~55.0.3",
52
- "expo-intent-launcher": "~55.0.3",
53
- "expo-insights": "~55.0.4",
50
+ "expo-image-manipulator": "~55.0.4",
51
+ "expo-image-picker": "~55.0.4",
52
+ "expo-intent-launcher": "~55.0.4",
53
+ "expo-insights": "~55.0.5",
54
54
  "expo-keep-awake": "~55.0.2",
55
- "expo-linear-gradient": "~55.0.3",
55
+ "expo-linear-gradient": "~55.0.4",
56
56
  "expo-linking": "~55.0.3",
57
- "expo-local-authentication": "~55.0.3",
58
- "expo-localization": "~55.0.3",
59
- "expo-location": "~55.0.4",
60
- "expo-mail-composer": "~55.0.3",
61
- "expo-manifests": "~55.0.3",
62
- "expo-maps": "~55.0.3",
57
+ "expo-local-authentication": "~55.0.4",
58
+ "expo-localization": "~55.0.4",
59
+ "expo-location": "~55.0.5",
60
+ "expo-mail-composer": "~55.0.4",
61
+ "expo-manifests": "~55.0.4",
62
+ "expo-maps": "~55.0.4",
63
63
  "expo-mcp": "~0.2.1",
64
- "expo-media-library": "~55.0.3",
65
- "expo-mesh-gradient": "~55.0.3",
64
+ "expo-media-library": "~55.0.4",
65
+ "expo-mesh-gradient": "~55.0.4",
66
66
  "expo-module-template": "~55.0.4",
67
- "expo-modules-core": "~55.0.5",
68
- "expo-navigation-bar": "~55.0.3",
69
- "expo-network": "~55.0.3",
70
- "expo-notifications": "~55.0.4",
71
- "expo-print": "~55.0.3",
72
- "expo-live-photo": "~55.0.3",
73
- "expo-router": "~55.0.0-beta.4",
74
- "expo-screen-capture": "~55.0.3",
75
- "expo-screen-orientation": "~55.0.3",
76
- "expo-secure-store": "~55.0.3",
77
- "expo-sensors": "~55.0.3",
78
- "expo-server": "~55.0.2",
79
- "expo-sharing": "~55.0.4",
80
- "expo-sms": "~55.0.3",
81
- "expo-speech": "~55.0.3",
82
- "expo-splash-screen": "~55.0.3",
83
- "expo-sqlite": "~55.0.3",
67
+ "expo-modules-core": "~55.0.7",
68
+ "expo-navigation-bar": "~55.0.4",
69
+ "expo-network": "~55.0.4",
70
+ "expo-notifications": "~55.0.5",
71
+ "expo-print": "~55.0.4",
72
+ "expo-live-photo": "~55.0.4",
73
+ "expo-router": "~55.0.0-preview.6",
74
+ "expo-screen-capture": "~55.0.4",
75
+ "expo-screen-orientation": "~55.0.4",
76
+ "expo-secure-store": "~55.0.4",
77
+ "expo-sensors": "~55.0.4",
78
+ "expo-server": "~55.0.3",
79
+ "expo-sharing": "~55.0.5",
80
+ "expo-sms": "~55.0.4",
81
+ "expo-speech": "~55.0.4",
82
+ "expo-splash-screen": "~55.0.4",
83
+ "expo-sqlite": "~55.0.4",
84
84
  "expo-status-bar": "~55.0.2",
85
- "expo-store-review": "~55.0.3",
85
+ "expo-store-review": "~55.0.4",
86
86
  "expo-symbols": "~55.0.3",
87
- "expo-system-ui": "~55.0.3",
88
- "expo-task-manager": "~55.0.3",
89
- "expo-tracking-transparency": "~55.0.3",
90
- "expo-updates": "~55.0.5",
91
- "expo-video-thumbnails": "~55.0.3",
92
- "expo-video": "~55.0.3",
93
- "expo-web-browser": "~55.0.3",
94
- "jest-expo": "~55.0.5",
87
+ "expo-system-ui": "~55.0.4",
88
+ "expo-task-manager": "~55.0.4",
89
+ "expo-tracking-transparency": "~55.0.4",
90
+ "expo-updates": "~55.0.6",
91
+ "expo-video-thumbnails": "~55.0.4",
92
+ "expo-video": "~55.0.4",
93
+ "expo-web-browser": "~55.0.4",
94
+ "jest-expo": "~55.0.6",
95
95
  "lottie-react-native": "~7.3.4",
96
96
  "react": "19.2.0",
97
97
  "react-dom": "19.2.0",
@@ -104,7 +104,7 @@
104
104
  "react-native-pager-view": "8.0.0",
105
105
  "react-native-worklets": "0.7.2",
106
106
  "react-native-reanimated": "~4.2.1",
107
- "react-native-screens": "~4.20.0",
107
+ "react-native-screens": "~4.22.0",
108
108
  "react-native-safe-area-context": "~5.6.2",
109
109
  "react-native-svg": "15.15.1",
110
110
  "react-native-view-shot": "4.0.3",
@@ -115,6 +115,6 @@
115
115
  "unimodules-image-loader-interface": "~6.1.0",
116
116
  "@shopify/react-native-skia": "2.4.14",
117
117
  "@shopify/flash-list": "2.0.2",
118
- "@sentry/react-native": "~7.10.0",
118
+ "@sentry/react-native": "~7.11.0",
119
119
  "react-native-bootsplash": "^6.3.10"
120
120
  }
@@ -24,7 +24,7 @@ NS_SWIFT_NAME(ExpoReactRootViewFactory)
24
24
  /**
25
25
  Calls super `viewWithModuleName:initialProperties:launchOptions:` from `RCTRootViewFactory`.
26
26
  */
27
- #if TARGET_OS_IOS
27
+ #if TARGET_OS_IOS || TARGET_OS_TV
28
28
  - (UIView *)superViewWithModuleName:(NSString *)moduleName
29
29
  initialProperties:(nullable NSDictionary *)initialProperties
30
30
  launchOptions:(nullable NSDictionary *)launchOptions
@@ -31,7 +31,7 @@
31
31
  return self;
32
32
  }
33
33
 
34
- #if TARGET_OS_IOS
34
+ #if TARGET_OS_IOS || TARGET_OS_TV
35
35
  - (UIView *)viewWithModuleName:(NSString *)moduleName
36
36
  initialProperties:(nullable NSDictionary *)initialProperties
37
37
  launchOptions:(nullable NSDictionary *)launchOptions
@@ -111,7 +111,7 @@ public class ExpoReactNativeFactory: ExpoReactNativeFactoryObjC, ExpoReactNative
111
111
  let rootView: UIView
112
112
  if let factory = self.rootViewFactory as? ExpoReactRootViewFactory {
113
113
  // RCTDevMenuConfiguration is only available in react-native 0.83+
114
- #if os(iOS)
114
+ #if os(iOS) || os(tvOS)
115
115
  // When calling `recreateRootViewWithBundleURL:` from `EXReactRootViewFactory`,
116
116
  // we don't want to loop the ReactDelegate again. Otherwise, it will be an infinite loop.
117
117
  rootView = factory.superView(
@@ -128,7 +128,7 @@ public class ExpoReactNativeFactory: ExpoReactNativeFactoryObjC, ExpoReactNative
128
128
  )
129
129
  #endif
130
130
  } else {
131
- #if os(iOS)
131
+ #if os(iOS) || os(tvOS)
132
132
  rootView = rootViewFactory.view(
133
133
  withModuleName: moduleName ?? defaultModuleName,
134
134
  initialProperties: initialProps,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo",
3
- "version": "55.0.0-preview.7",
3
+ "version": "55.0.0-preview.9",
4
4
  "description": "The Expo SDK",
5
5
  "main": "src/Expo.ts",
6
6
  "module": "src/Expo.ts",
@@ -77,32 +77,32 @@
77
77
  "homepage": "https://github.com/expo/expo/tree/main/packages/expo",
78
78
  "dependencies": {
79
79
  "@babel/runtime": "^7.20.0",
80
- "@expo/cli": "55.0.4",
81
- "@expo/config": "~55.0.3",
82
- "@expo/config-plugins": "~55.0.3",
80
+ "@expo/cli": "55.0.6",
81
+ "@expo/config": "~55.0.4",
82
+ "@expo/config-plugins": "~55.0.4",
83
83
  "@expo/devtools": "55.0.2",
84
- "@expo/fingerprint": "0.16.2",
85
- "@expo/local-build-cache-provider": "55.0.2",
84
+ "@expo/fingerprint": "0.16.3",
85
+ "@expo/local-build-cache-provider": "55.0.3",
86
+ "@expo/log-box": "55.0.5",
86
87
  "@expo/metro": "~54.2.0",
87
- "@expo/metro-config": "55.0.3",
88
+ "@expo/metro-config": "55.0.4",
88
89
  "@expo/vector-icons": "^15.0.2",
89
- "@expo/log-box": "55.0.3",
90
90
  "@ungap/structured-clone": "^1.3.0",
91
- "babel-preset-expo": "~55.0.2",
92
- "expo-asset": "~55.0.2",
93
- "expo-constants": "~55.0.2",
94
- "expo-file-system": "~55.0.3",
91
+ "babel-preset-expo": "~55.0.3",
92
+ "expo-asset": "~55.0.3",
93
+ "expo-constants": "~55.0.3",
94
+ "expo-file-system": "~55.0.4",
95
95
  "expo-font": "~55.0.3",
96
96
  "expo-keep-awake": "~55.0.2",
97
- "expo-modules-autolinking": "55.0.2",
98
- "expo-modules-core": "55.0.5",
97
+ "expo-modules-autolinking": "55.0.3",
98
+ "expo-modules-core": "55.0.7",
99
99
  "pretty-format": "^29.7.0",
100
100
  "react-refresh": "^0.14.2",
101
- "whatwg-url-without-unicode": "8.0.0-3"
101
+ "whatwg-url-minimum": "^0.1.1"
102
102
  },
103
103
  "devDependencies": {
104
- "@expo/dom-webview": "55.0.2",
105
- "@expo/metro-runtime": "^55.0.3",
104
+ "@expo/dom-webview": "^55.0.2",
105
+ "@expo/metro-runtime": "^55.0.4",
106
106
  "@types/node": "^22.14.0",
107
107
  "@types/react": "~19.2.0",
108
108
  "@types/react-test-renderer": "~19.1.0",
@@ -130,5 +130,5 @@
130
130
  "optional": true
131
131
  }
132
132
  },
133
- "gitHead": "220594d473a3100248087151004ae4acb7282d5f"
133
+ "gitHead": "feb52bad4c6c47d4c010248e74265eb3d9873371"
134
134
  }
package/src/winter/url.ts CHANGED
@@ -8,8 +8,7 @@
8
8
 
9
9
  // This file should not import `react-native` in order to remain self-contained.
10
10
 
11
- /// <reference path="../ts-declarations/whatwg-url-without-unicode.d.ts" />
12
- import { URL, URLSearchParams } from 'whatwg-url-without-unicode';
11
+ import { URL, URLSearchParams } from 'whatwg-url-minimum';
13
12
 
14
13
  declare namespace globalThis {
15
14
  const RN$Bridgeless: undefined | boolean;
@@ -56,14 +55,13 @@ function getBlobUrlPrefix() {
56
55
  return BLOB_URL_PREFIX;
57
56
  }
58
57
 
59
- declare module 'whatwg-url-without-unicode' {
58
+ declare module 'whatwg-url-minimum' {
60
59
  // TODO(@kitten): Clarify where this came from
61
60
  type BlobLike = Blob & { data?: { blobId: string; offset: number } };
62
61
 
63
62
  interface URLConstructor {
64
63
  createObjectURL(blob: BlobLike): string;
65
64
  revokeObjectURL(url: URL): void;
66
- canParse(url: string, base?: string): boolean;
67
65
  }
68
66
  }
69
67
 
@@ -91,7 +89,9 @@ declare module 'whatwg-url-without-unicode' {
91
89
  * </resources>
92
90
  * ```
93
91
  */
94
- URL.createObjectURL = function createObjectURL(blob) {
92
+ URL.createObjectURL = function createObjectURL(
93
+ blob: Blob & { data?: { blobId: string; offset: number } }
94
+ ) {
95
95
  if (getBlobUrlPrefix() == null) {
96
96
  throw new Error('Cannot create URL for blob');
97
97
  }
@@ -104,14 +104,4 @@ URL.revokeObjectURL = function revokeObjectURL(_url) {
104
104
  // Do nothing.
105
105
  };
106
106
 
107
- URL.canParse = function canParse(url: string, base?: string): boolean {
108
- try {
109
- // eslint-disable-next-line no-new
110
- new URL(url, base);
111
- return true;
112
- } catch {
113
- return false;
114
- }
115
- };
116
-
117
107
  export { URL, URLSearchParams };
package/template.tgz CHANGED
Binary file
package/types/global.d.ts CHANGED
@@ -1,11 +1,4 @@
1
- /// <reference types="node" />
2
-
3
- // Extend the NodeJS namespace
4
- declare namespace NodeJS {
5
- interface ProcessEnv {
6
- readonly NODE_ENV: 'development' | 'production' | 'test';
7
- }
8
- }
1
+ /* eslint-disable */
9
2
 
10
3
  // Create types for CSS modules
11
4
  declare module '*.module.css' {
package/types/index.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ /// <reference types="expo-modules-core/types" />
2
+
1
3
  /// <reference types="./global" />
2
4
  /// <reference types="./metro-require" />
3
5
  /// <reference types="./react-native-web" />
@@ -1,11 +1,20 @@
1
- // Based on https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/webpack-env/index.d.ts
2
- // Adds support for the runtime `require.context` method.
3
- // https://github.com/facebook/metro/pull/822/
1
+ /* eslint-disable */
4
2
 
5
- declare var module: NodeModule;
3
+ // NOTE: This module is named `metro-require.d.ts` for backwards compatibility, since it's accessible to users
4
+ // However, it's supposed to be understood more as a "Metro environment" typings file that provides types for `require` and `module`,
5
+ // regardless of if `@types/node` is present, and/or, to enhance `@types/node` if it's present
6
6
 
7
7
  declare namespace __MetroModuleApi {
8
- interface RequireContext {
8
+ export interface ProcessEnv {
9
+ readonly NODE_ENV: 'development' | 'production' | 'test';
10
+ [key: string]: string | undefined;
11
+ }
12
+
13
+ export interface Process {
14
+ env: ProcessEnv;
15
+ }
16
+
17
+ export interface RequireContext {
9
18
  /** Return the keys that can be resolved. */
10
19
  keys(): string[];
11
20
  (id: string): any;
@@ -16,7 +25,8 @@ declare namespace __MetroModuleApi {
16
25
  id: string;
17
26
  }
18
27
 
19
- interface RequireFunction {
28
+ // Adds support for the runtime `require.context` method.
29
+ export interface RequireFunction {
20
30
  /**
21
31
  * Returns the exports from a dependency. The call is sync. No request to the server is fired. The compiler ensures that the dependency is available.
22
32
  */
@@ -40,13 +50,19 @@ declare namespace __MetroModuleApi {
40
50
  mode?: 'sync' | 'eager' | 'weak' | 'lazy' | 'lazy-once'
41
51
  ): RequireContext;
42
52
  }
53
+
54
+ export interface Module {
55
+ exports: any;
56
+ }
43
57
  }
44
58
 
45
- /**
46
- * Declare process variable
47
- */
48
59
  declare namespace NodeJS {
49
- interface Require extends __MetroModuleApi.RequireFunction {}
60
+ export interface Require extends __MetroModuleApi.RequireFunction {}
61
+ export interface Module extends __MetroModuleApi.Module {}
62
+ export interface ProcessEnv extends __MetroModuleApi.ProcessEnv {}
63
+ export interface Process extends __MetroModuleApi.Process {}
50
64
  }
51
65
 
52
- declare var require: NodeRequire;
66
+ declare var require: NodeJS.Require;
67
+ declare var module: NodeJS.Module;
68
+ declare var process: NodeJS.Process;
@@ -1,3 +1,5 @@
1
+ /* eslint-disable */
2
+
1
3
  import { StyleProp } from 'react-native';
2
4
  import * as RN from 'react-native';
3
5
 
@@ -1,186 +0,0 @@
1
- // NOTE(@kitten): This is based on @types/whatwg-url
2
- declare module 'whatwg-url-without-unicode' {
3
- /// <reference lib="es2020"/>
4
- /** https://url.spec.whatwg.org/#url-representation */
5
- export interface URLRecord {
6
- scheme: string;
7
- username: string;
8
- password: string;
9
- host: string | number | IPv6Address | null;
10
- port: number | null;
11
- path: string | string[];
12
- query: string | null;
13
- fragment: string | null;
14
- }
15
-
16
- /** https://url.spec.whatwg.org/#concept-ipv6 */
17
- export type IPv6Address = [number, number, number, number, number, number, number, number];
18
-
19
- // NOTE(@kitten): This is a custom modification to add static methods with an overlay
20
- // We should make this available to users in expo/types, which should be linked to our own Winter implementation,
21
- // and compatible with built-ins. Until then, we're adding this so we can polyfill properly in `src/winter/url.ts`
22
- export const URL: URLConstructor;
23
- export interface URLConstructor {
24
- new (url: string, base?: string | URL): URL;
25
- (url: string, base?: string | URL): URL;
26
- canParse(url: string, base?: string): boolean;
27
- }
28
-
29
- /** https://url.spec.whatwg.org/#url-class */
30
- interface URL {
31
- constructor(url: string, base?: string | URL);
32
-
33
- get href(): string;
34
- set href(V: string);
35
-
36
- get origin(): string;
37
-
38
- get protocol(): string;
39
- set protocol(V: string);
40
-
41
- get username(): string;
42
- set username(V: string);
43
-
44
- get password(): string;
45
- set password(V: string);
46
-
47
- get host(): string;
48
- set host(V: string);
49
-
50
- get hostname(): string;
51
- set hostname(V: string);
52
-
53
- get port(): string;
54
- set port(V: string);
55
-
56
- get pathname(): string;
57
- set pathname(V: string);
58
-
59
- get search(): string;
60
- set search(V: string);
61
-
62
- get searchParams(): URLSearchParams;
63
-
64
- get hash(): string;
65
- set hash(V: string);
66
-
67
- toJSON(): string;
68
-
69
- readonly [Symbol.toStringTag]: 'URL';
70
- }
71
-
72
- /** https://url.spec.whatwg.org/#interface-urlsearchparams */
73
- export class URLSearchParams {
74
- constructor(
75
- init?:
76
- | readonly (readonly [name: string, value: string])[]
77
- | Iterable<readonly [name: string, value: string]>
78
- | { readonly [name: string]: string }
79
- | string
80
- );
81
-
82
- get size(): number;
83
- append(name: string, value: string): void;
84
- delete(name: string, value?: string): void;
85
- get(name: string): string | null;
86
- getAll(name: string): string[];
87
- has(name: string, value?: string): boolean;
88
- set(name: string, value: string): void;
89
- sort(): void;
90
-
91
- keys(): IterableIterator<string>;
92
- values(): IterableIterator<string>;
93
- entries(): IterableIterator<[name: string, value: string]>;
94
- forEach<THIS_ARG = void>(
95
- callback: (this: THIS_ARG, value: string, name: string, searchParams: this) => void,
96
- thisArg?: THIS_ARG
97
- ): void;
98
-
99
- readonly [Symbol.toStringTag]: 'URLSearchParams';
100
- [Symbol.iterator](): IterableIterator<[name: string, value: string]>;
101
- }
102
-
103
- /** https://url.spec.whatwg.org/#concept-url-parser */
104
- export function parseURL(
105
- input: string,
106
- options?: { readonly baseURL?: URLRecord | undefined }
107
- ): URLRecord | null;
108
-
109
- /** https://url.spec.whatwg.org/#concept-basic-url-parser */
110
- export function basicURLParse(
111
- input: string,
112
- options?: {
113
- baseURL?: URLRecord | undefined;
114
- url?: URLRecord | undefined;
115
- stateOverride?: StateOverride | undefined;
116
- }
117
- ): URLRecord | null;
118
-
119
- /** https://url.spec.whatwg.org/#scheme-start-state */
120
- export type StateOverride =
121
- | 'scheme start'
122
- | 'scheme'
123
- | 'no scheme'
124
- | 'special relative or authority'
125
- | 'path or authority'
126
- | 'relative'
127
- | 'relative slash'
128
- | 'special authority slashes'
129
- | 'special authority ignore slashes'
130
- | 'authority'
131
- | 'host'
132
- | 'hostname'
133
- | 'port'
134
- | 'file'
135
- | 'file slash'
136
- | 'file host'
137
- | 'path start'
138
- | 'path'
139
- | 'opaque path'
140
- | 'query'
141
- | 'fragment';
142
-
143
- /** https://url.spec.whatwg.org/#concept-url-serializer */
144
- export function serializeURL(urlRecord: URLRecord, excludeFragment?: boolean): string;
145
-
146
- /** https://url.spec.whatwg.org/#concept-host-serializer */
147
- export function serializeHost(host: string | number | IPv6Address): string;
148
-
149
- /** https://url.spec.whatwg.org/#url-path-serializer */
150
- export function serializePath(urlRecord: URLRecord): string;
151
-
152
- /** https://url.spec.whatwg.org/#serialize-an-integer */
153
- export function serializeInteger(number: number): string;
154
-
155
- /** https://html.spec.whatwg.org#ascii-serialisation-of-an-origin */
156
- export function serializeURLOrigin(urlRecord: URLRecord): string;
157
-
158
- /** https://url.spec.whatwg.org/#set-the-username */
159
- export function setTheUsername(urlRecord: URLRecord, username: string): void;
160
-
161
- /** https://url.spec.whatwg.org/#set-the-password */
162
- export function setThePassword(urlRecord: URLRecord, password: string): void;
163
-
164
- /** https://url.spec.whatwg.org/#url-opaque-path */
165
- export function hasAnOpaquePath(urlRecord: URLRecord): boolean;
166
-
167
- /** https://url.spec.whatwg.org/#cannot-have-a-username-password-port */
168
- export function cannotHaveAUsernamePasswordPort(urlRecord: URLRecord): boolean;
169
-
170
- /** https://url.spec.whatwg.org/#percent-decode */
171
- export function percentDecodeBytes(buffer: TypedArray): Uint8Array;
172
-
173
- /** https://url.spec.whatwg.org/#string-percent-decode */
174
- export function percentDecodeString(string: string): Uint8Array;
175
-
176
- export type TypedArray =
177
- | Uint8Array
178
- | Uint8ClampedArray
179
- | Uint16Array
180
- | Uint32Array
181
- | Int8Array
182
- | Int16Array
183
- | Int32Array
184
- | Float32Array
185
- | Float64Array;
186
- }