@nativescript/ios 9.1.0-alpha.18 → 9.1.0-alpha.19

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.
@@ -505,7 +505,7 @@
505
505
  repositoryURL = "https://github.com/NativeScript/ios-spm.git";
506
506
  requirement = {
507
507
  kind = exactVersion;
508
- version = "9.1.0-alpha.18";
508
+ version = "9.1.0-alpha.19";
509
509
  };
510
510
  };
511
511
  /* End XCRemoteSwiftPackageReference section */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nativescript/ios",
3
3
  "description": "NativeScript Runtime for iOS",
4
- "version": "9.1.0-alpha.18",
4
+ "version": "9.1.0-alpha.19",
5
5
  "keywords": [
6
6
  "NativeScript",
7
7
  "iOS",
@@ -16,6 +16,7 @@
16
16
  "email": "oss@nativescript.org"
17
17
  },
18
18
  "directories": {},
19
+ "types": "./types/index.d.ts",
19
20
  "files": [
20
21
  "**/*"
21
22
  ],
@@ -42,7 +43,7 @@
42
43
  },
43
44
  "lint-staged": {
44
45
  "{NativeScript,metadata-generator/src,TestFixtures}/**/*.{h,hpp,c,cpp,mm,m}": [
45
- "clang-format -i"
46
+ "tools/format-staged-native.sh"
46
47
  ],
47
48
  "NativeScript/runtime/js/**/*.js": [
48
49
  "eslint"
@@ -0,0 +1,27 @@
1
+ // Type declarations for the runtime's public `ns:` builtin modules — one
2
+ // .d.ts per module, mirroring @types/node's layout and the "one module, one
3
+ // source file" rule in docs/ns-builtin-modules.md. The declared surfaces must
4
+ // stay in sync with that document (NsRuntimeTests.js / NsUtilTests.js /
5
+ // HttpEsmLoaderTests.js assert the export sets at runtime).
6
+ //
7
+ // `ns:` is not a resolvable package specifier, so these are ambient
8
+ // declarations: they apply program-wide once this file is in the TypeScript
9
+ // program. Pull it in with either
10
+ //
11
+ // /// <reference types="@nativescript/ios" />
12
+ //
13
+ // or a tsconfig entry:
14
+ //
15
+ // { "include": ["node_modules/@nativescript/ios/types/index.d.ts"] }
16
+ //
17
+ // These files are the source of truth for `ns:*` types. Downstream type
18
+ // packages must reference them, not redeclare the modules — two
19
+ // `declare module` blocks for the same specifier conflict.
20
+ //
21
+ // The `node:util` compatibility shim is deliberately not declared here:
22
+ // programs that include @types/node already have a `node:util` declaration,
23
+ // and a second one would clash with it.
24
+
25
+ /// <reference path="./ns-module.d.ts" />
26
+ /// <reference path="./ns-runtime.d.ts" />
27
+ /// <reference path="./ns-util.d.ts" />
@@ -0,0 +1,78 @@
1
+ declare module "ns:module" {
2
+ /**
3
+ * An import map in the WHATWG shape the dev server emits: bare specifier →
4
+ * absolute URL. Consulted inside the engine's synchronous module resolver,
5
+ * which is why it must be handed to the runtime ahead of time rather than
6
+ * resolved on demand.
7
+ */
8
+ export interface ImportMap {
9
+ imports: Record<string, string>;
10
+ }
11
+
12
+ /**
13
+ * The URL vocabulary the runtime's canonical-key function applies when
14
+ * keying its module registry. The mechanism (fragment strip, cache-buster
15
+ * param drop, param sort) is native; this vocabulary is server policy and
16
+ * is supplied by the development tooling.
17
+ */
18
+ export interface CanonicalizationConfig {
19
+ /**
20
+ * Query param names that are pure cache busters and are dropped for dev
21
+ * endpoints (e.g. `t`, `v`, `import`).
22
+ */
23
+ stripParams?: string[];
24
+ /**
25
+ * Path prefixes (starts-with) identifying dev endpoints whose query may
26
+ * be normalized (e.g. `/ns/`, `/@id/`).
27
+ */
28
+ forPathPrefixes?: string[];
29
+ /**
30
+ * Path substrings whose query IS the module identity and must be
31
+ * preserved verbatim (e.g. `/@ng/component`).
32
+ */
33
+ preserveQueryFor?: string[];
34
+ }
35
+
36
+ /**
37
+ * Loader policy, installed before the dev session imports anything. Every
38
+ * section is optional; each present section replaces its native state
39
+ * wholesale.
40
+ */
41
+ export interface LoaderConfig {
42
+ importMap?: ImportMap;
43
+ /** URL substrings identifying modules that are always re-fetched, never cached. */
44
+ volatilePatterns?: string[];
45
+ canonicalization?: CanonicalizationConfig;
46
+ }
47
+
48
+ /**
49
+ * Installs loader policy — the sole channel by which server/framework URL
50
+ * policy enters the runtime's module loader.
51
+ */
52
+ export function configureLoader(config: LoaderConfig): void;
53
+
54
+ /**
55
+ * Evicts the given URLs (canonicalized) from the module registry and marks
56
+ * them bust-next-fetch, so the next network fetch bypasses every HTTP
57
+ * cache layer.
58
+ */
59
+ export function invalidateModules(urls: string[]): void;
60
+
61
+ /**
62
+ * The URL-like keys currently in the module registry (used to compute
63
+ * full-reload eviction sets).
64
+ */
65
+ export function getLoadedModuleUrls(): string[];
66
+
67
+ /**
68
+ * Flips the dev-boot-complete signal (defaults to `true`); disarms
69
+ * cold-boot-only behaviors.
70
+ */
71
+ export function setDevBootComplete(value?: boolean): void;
72
+
73
+ // Debug builds additionally carry `canonicalizeHttpUrlKey(url)`, a pure
74
+ // test diagnostic; release builds omit the member entirely. It is
75
+ // deliberately not declared here: it is not public API, and declaring it
76
+ // unconditionally would misrepresent release builds, where feature checks
77
+ // must observe it as absent.
78
+ }
@@ -0,0 +1,46 @@
1
+ declare module "ns:runtime" {
2
+ /**
3
+ * Controls what happens when JS touches a wrapper whose native counterpart
4
+ * has already been released:
5
+ *
6
+ * - `"report"` (default): the operation no-ops and a cancelable
7
+ * `releasednativeaccess` event fires on `globalThis`.
8
+ * - `"throw"`: the touch throws a catchable `ReferenceError` synchronously,
9
+ * and no event fires.
10
+ */
11
+ export type ReleasedObjectPolicy = "report" | "throw";
12
+
13
+ /**
14
+ * The config keys these types know about, mapped to their value domains.
15
+ *
16
+ * Keys are registered and validated natively, and other runtimes (or newer
17
+ * runtime versions) may register keys not listed here — `setConfig` and
18
+ * `getConfig` therefore accept any string key, falling back to `unknown`
19
+ * for the value. A runtime's own types can merge additional keys into this
20
+ * interface via declaration merging.
21
+ */
22
+ export interface RuntimeConfig {
23
+ releasedObjectPolicy: ReleasedObjectPolicy;
24
+ }
25
+
26
+ /**
27
+ * Sets a runtime config key.
28
+ *
29
+ * Throws `TypeError` on an unknown key, an invalid value, or — for
30
+ * process-wide keys such as `releasedObjectPolicy` — when called from a
31
+ * worker isolate.
32
+ */
33
+ export function setConfig<K extends keyof RuntimeConfig | (string & {})>(
34
+ key: K,
35
+ value: K extends keyof RuntimeConfig ? RuntimeConfig[K] : unknown
36
+ ): void;
37
+
38
+ /**
39
+ * Returns the current value of a config key. Readable from any isolate.
40
+ *
41
+ * Throws `TypeError` on an unknown key.
42
+ */
43
+ export function getConfig<K extends keyof RuntimeConfig | (string & {})>(
44
+ key: K
45
+ ): K extends keyof RuntimeConfig ? RuntimeConfig[K] : unknown;
46
+ }
@@ -0,0 +1,26 @@
1
+ declare module "ns:util" {
2
+ export interface InspectOptions {
3
+ /** Recursion depth for nested objects. Default: `2`. */
4
+ depth?: number;
5
+ }
6
+
7
+ /**
8
+ * Formats any value for human consumption: depth-limited, output-capped,
9
+ * cycle-safe, and never invokes getters (except a guarded `error.stack`
10
+ * read and custom `toString` overrides, which are honored).
11
+ *
12
+ * The output may change between runtime versions for readability; it is
13
+ * intended for humans and must not be parsed programmatically.
14
+ */
15
+ export function inspect(value: unknown, options?: InspectOptions): string;
16
+
17
+ /**
18
+ * Node-style printf formatting: `%s`, `%d`, `%i`, `%f`, `%j`, `%o`, `%O`,
19
+ * `%%`. Extra arguments are appended space-separated, objects rendered via
20
+ * {@link inspect}. When `format` is not a string or contains no
21
+ * substitutions, all arguments are formatted and joined with spaces.
22
+ *
23
+ * `console.*` routes its arguments through this.
24
+ */
25
+ export function format(format?: unknown, ...args: unknown[]): string;
26
+ }