@opencode/codemode 2.0.2 → 2.0.4

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.
Files changed (71) hide show
  1. package/dist/codemode.d.ts +3 -0
  2. package/dist/codemode.js +12 -1
  3. package/dist/data.d.ts +14 -21
  4. package/dist/data.js +72 -140
  5. package/dist/extension.d.ts +11 -0
  6. package/dist/extension.js +9 -0
  7. package/dist/index.d.ts +1 -0
  8. package/dist/index.js +1 -0
  9. package/dist/interpreter/callback.d.ts +20 -0
  10. package/dist/interpreter/{runner.js → callback.js} +14 -14
  11. package/dist/interpreter/errors.d.ts +12 -5
  12. package/dist/interpreter/errors.js +66 -54
  13. package/dist/interpreter/execute.d.ts +2 -2
  14. package/dist/interpreter/execute.js +15 -15
  15. package/dist/interpreter/extensions.d.ts +8 -0
  16. package/dist/interpreter/extensions.js +155 -0
  17. package/dist/interpreter/generators.d.ts +2 -3
  18. package/dist/interpreter/generators.js +10 -10
  19. package/dist/interpreter/globals.d.ts +4 -12
  20. package/dist/interpreter/globals.js +56 -49
  21. package/dist/interpreter/interpreter.d.ts +34 -0
  22. package/dist/interpreter/{runtime.js → interpreter.js} +250 -215
  23. package/dist/interpreter/intrinsics.d.ts +5 -5
  24. package/dist/interpreter/intrinsics.js +16 -10
  25. package/dist/interpreter/limits.d.ts +10 -0
  26. package/dist/interpreter/limits.js +19 -0
  27. package/dist/interpreter/model.d.ts +27 -14
  28. package/dist/interpreter/model.js +22 -14
  29. package/dist/interpreter/native.d.ts +12 -13
  30. package/dist/interpreter/native.js +17 -16
  31. package/dist/interpreter/objects.d.ts +55 -48
  32. package/dist/interpreter/objects.js +64 -44
  33. package/dist/interpreter/promises.d.ts +13 -15
  34. package/dist/interpreter/promises.js +89 -85
  35. package/dist/interpreter/references.d.ts +1 -2
  36. package/dist/interpreter/references.js +18 -16
  37. package/dist/interpreter/scope.js +6 -6
  38. package/dist/openapi/types.d.ts +1 -1
  39. package/dist/stdlib/array.d.ts +3 -4
  40. package/dist/stdlib/array.js +115 -110
  41. package/dist/stdlib/bytes.d.ts +10 -0
  42. package/dist/stdlib/bytes.js +228 -0
  43. package/dist/stdlib/collections.d.ts +4 -4
  44. package/dist/stdlib/collections.js +89 -89
  45. package/dist/stdlib/console.d.ts +5 -3
  46. package/dist/stdlib/console.js +30 -37
  47. package/dist/stdlib/date.d.ts +2 -2
  48. package/dist/stdlib/date.js +35 -35
  49. package/dist/stdlib/json.d.ts +3 -3
  50. package/dist/stdlib/json.js +29 -67
  51. package/dist/stdlib/math.d.ts +3 -3
  52. package/dist/stdlib/math.js +17 -21
  53. package/dist/stdlib/number.d.ts +3 -3
  54. package/dist/stdlib/number.js +32 -36
  55. package/dist/stdlib/object.d.ts +5 -5
  56. package/dist/stdlib/object.js +59 -62
  57. package/dist/stdlib/regexp.d.ts +7 -8
  58. package/dist/stdlib/regexp.js +40 -48
  59. package/dist/stdlib/string.d.ts +2 -2
  60. package/dist/stdlib/string.js +110 -88
  61. package/dist/stdlib/url.d.ts +4 -6
  62. package/dist/stdlib/url.js +86 -90
  63. package/dist/stdlib/value.d.ts +3 -3
  64. package/dist/stdlib/value.js +26 -24
  65. package/dist/stdlib/web.d.ts +4 -4
  66. package/dist/stdlib/web.js +22 -8
  67. package/dist/tool-runtime.d.ts +12 -5
  68. package/dist/tool-runtime.js +25 -11
  69. package/package.json +1 -1
  70. package/dist/interpreter/runner.d.ts +0 -28
  71. package/dist/interpreter/runtime.d.ts +0 -19
@@ -1,27 +1,27 @@
1
1
  import { Effect } from "effect";
2
- import { toProgram } from "../data.js";
3
2
  import { constructor, methods } from "../interpreter/native.js";
4
- import { InterpreterRuntimeError, rangeError } from "../interpreter/model.js";
5
- import { ProgramArray, ProgramPromise, ProgramRegExp, record } from "../interpreter/objects.js";
3
+ import { checkArrayLength, checkStringLength } from "../interpreter/limits.js";
4
+ import { invalidData, rangeError, typeError } from "../interpreter/model.js";
5
+ import { Arr, PromiseObj, RegExpObj, record } from "../interpreter/objects.js";
6
6
  import { containsOpaqueReference, typeofValue } from "../interpreter/references.js";
7
- import { applyCollectionCallback, isSupportedCallback } from "../interpreter/runner.js";
7
+ import { applyCollectionCallback, isSupportedCallback } from "../interpreter/callback.js";
8
8
  import { matchToValue, toHostRegex } from "./regexp.js";
9
9
  import { coerceToNumber, coerceToString, coercion } from "./value.js";
10
10
  // console is intercepted by the interpreter before reaching here.
11
- const requireDataArgument = (name, index, arg, node) => {
11
+ const requireDataArgument = (name, index, arg) => {
12
12
  if (containsOpaqueReference(arg)) {
13
- throw new InterpreterRuntimeError(`String.${name} expects argument ${index + 1} to be a data value.`, node, "InvalidDataValue");
13
+ throw invalidData(`String.${name} expects argument ${index + 1} to be a data value.`);
14
14
  }
15
15
  return arg;
16
16
  };
17
- const replaceAllNeedsGlobal = (pattern, node) => {
17
+ const replaceAllNeedsGlobal = (pattern) => {
18
18
  if (!pattern.global) {
19
- throw new InterpreterRuntimeError(`String.replaceAll requires a regular expression with the global (g) flag: write /${pattern.source}/${pattern.flags}g, or use String.replace to replace only the first match.`, node);
19
+ throw typeError(`String.replaceAll requires a regular expression with the global (g) flag: write /${pattern.source}/${pattern.flags}g, or use String.replace to replace only the first match.`);
20
20
  }
21
21
  };
22
- const replaceWithCallback = (runner, value, name, args, node) => {
23
- const protos = runner.prototypes;
24
- const apply = applyCollectionCallback(runner, args[1], `String.${name}`, node);
22
+ const replaceWithCallback = (ctx, value, name, args) => {
23
+ const builtins = ctx.builtins;
24
+ const apply = applyCollectionCallback(ctx, args[1], `String.${name}`);
25
25
  const matches = [];
26
26
  const collect = (...callbackArgs) => {
27
27
  const match = callbackArgs[0];
@@ -29,24 +29,24 @@ const replaceWithCallback = (runner, value, name, args, node) => {
29
29
  const hasGroups = groups !== null && typeof groups === "object";
30
30
  const offset = callbackArgs[callbackArgs.length - (hasGroups ? 3 : 2)];
31
31
  if (typeof match !== "string" || typeof offset !== "number") {
32
- throw new InterpreterRuntimeError(`String.${name} produced an invalid replacement match.`, node);
32
+ throw typeError(`String.${name} produced an invalid replacement match.`);
33
33
  }
34
34
  if (hasGroups)
35
- callbackArgs[callbackArgs.length - 1] = record(protos.Object, groups);
35
+ callbackArgs[callbackArgs.length - 1] = record(builtins.Object, groups);
36
36
  matches.push({ match, offset, args: callbackArgs });
37
37
  return match;
38
38
  };
39
39
  const pattern = args[0];
40
- if (pattern instanceof ProgramRegExp) {
40
+ if (pattern instanceof RegExpObj) {
41
41
  if (name === "replaceAll")
42
- replaceAllNeedsGlobal(pattern.regex, node);
42
+ replaceAllNeedsGlobal(pattern.regex);
43
43
  if (name === "replace")
44
44
  value.replace(pattern.regex, collect);
45
45
  else
46
46
  value.replaceAll(pattern.regex, collect);
47
47
  }
48
48
  else {
49
- const search = coerceToString(requireDataArgument(name, 0, pattern, node));
49
+ const search = coerceToString(requireDataArgument(name, 0, pattern));
50
50
  if (name === "replace")
51
51
  value.replace(search, collect);
52
52
  else
@@ -57,73 +57,75 @@ const replaceWithCallback = (runner, value, name, args, node) => {
57
57
  let end = 0;
58
58
  for (const match of matches) {
59
59
  const replacement = yield* apply(match.args);
60
- output.push(value.slice(end, match.offset), replacement instanceof ProgramPromise
61
- ? "[object Promise]"
62
- : coerceToString(toProgram(protos, replacement, `String.${name} replacer result`)));
60
+ output.push(value.slice(end, match.offset), replacement instanceof PromiseObj ? "[object Promise]" : coerceToString(replacement));
63
61
  end = match.offset + match.match.length;
64
62
  }
65
63
  output.push(value.slice(end));
66
64
  return output.join("");
67
65
  });
68
66
  };
69
- export const stringGlobal = (runner) => {
70
- const protos = runner.prototypes;
71
- const string = constructor(protos, protos.String, {
67
+ export const stringGlobal = (ctx) => {
68
+ const builtins = ctx.builtins;
69
+ const string = constructor(builtins, builtins.String, {
72
70
  name: "String",
73
71
  length: 1,
74
- call: coercion(runner, "String").call,
72
+ call: coercion(ctx, "String").call,
75
73
  });
76
74
  const codeUnits = (name, op) => [
77
75
  name,
78
76
  1,
79
- (_, args, node) => op(...args.map((arg) => {
77
+ (_, args) => op(...args.map((arg) => {
80
78
  if (typeof arg !== "number") {
81
- throw new InterpreterRuntimeError(`String.${name} expects number arguments.`, node);
79
+ throw typeError(`String.${name} expects number arguments.`);
82
80
  }
83
81
  return arg;
84
82
  })),
85
83
  ];
86
- methods(protos, string, [
84
+ methods(builtins, string, [
87
85
  codeUnits("fromCharCode", String.fromCharCode),
88
86
  codeUnits("fromCodePoint", String.fromCodePoint),
89
87
  ]);
90
- const self = (thisValue, name, node) => {
88
+ const self = (thisValue, name) => {
91
89
  if (typeof thisValue === "string")
92
90
  return thisValue;
93
91
  if (thisValue === null || thisValue === undefined) {
94
- throw new InterpreterRuntimeError(`String.prototype.${name} called on null or undefined.`, node);
92
+ throw typeError(`String.prototype.${name} called on null or undefined.`);
95
93
  }
96
94
  return coerceToString(thisValue);
97
95
  };
98
96
  // Coerce arguments like native JS; opaque runtime references still reject.
99
- const str = (name, args, index, node) => coerceToString(requireDataArgument(name, index, args[index], node));
100
- const num = (name, args, index, node) => coerceToNumber(requireDataArgument(name, index, args[index], node));
101
- const optNum = (name, args, index, node) => args[index] === undefined ? undefined : num(name, args, index, node);
102
- const optStr = (name, args, index, node) => args[index] === undefined ? undefined : str(name, args, index, node);
103
- const rejectRegex = (name, args, node) => {
104
- if (args[0] instanceof ProgramRegExp) {
105
- throw new InterpreterRuntimeError(`String.${name} cannot take a regular expression; use regex.test(string) or String.search instead.`, node);
97
+ const str = (name, args, index) => coerceToString(requireDataArgument(name, index, args[index]));
98
+ const num = (name, args, index) => coerceToNumber(requireDataArgument(name, index, args[index]));
99
+ const optNum = (name, args, index) => args[index] === undefined ? undefined : num(name, args, index);
100
+ const optStr = (name, args, index) => args[index] === undefined ? undefined : str(name, args, index);
101
+ const rejectRegex = (name, args) => {
102
+ if (args[0] instanceof RegExpObj) {
103
+ throw typeError(`String.${name} cannot take a regular expression; use regex.test(string) or String.search instead.`);
106
104
  }
107
105
  };
108
- const simple = (name, length, op) => [name, length, (thisValue, args, node) => op(self(thisValue, name, node), args, node)];
109
- const replace = (name) => simple(name, 2, (value, args, node) => {
106
+ const simple = (name, length, op) => [
107
+ name,
108
+ length,
109
+ (thisValue, args) => op(self(thisValue, name), args),
110
+ ];
111
+ const replace = (name) => simple(name, 2, (value, args) => {
110
112
  if (isSupportedCallback(args[1]))
111
- return replaceWithCallback(runner, value, name, args, node);
113
+ return replaceWithCallback(ctx, value, name, args);
112
114
  if (typeofValue(args[1]) === "function") {
113
- throw new InterpreterRuntimeError(`String.${name} cannot use this callable as a replacer; wrap it in an arrow function, e.g. (match) => tools.ns.tool(match).`, node);
115
+ throw typeError(`String.${name} cannot use this callable as a replacer; wrap it in an arrow function, e.g. (match) => tools.ns.tool(match).`);
114
116
  }
115
- if (args[0] instanceof ProgramRegExp) {
117
+ if (args[0] instanceof RegExpObj) {
116
118
  const pattern = args[0].regex;
117
- const replacement = str(name, args, 1, node);
119
+ const replacement = str(name, args, 1);
118
120
  if (name === "replaceAll")
119
- replaceAllNeedsGlobal(pattern, node);
121
+ replaceAllNeedsGlobal(pattern);
120
122
  return name === "replace" ? value.replace(pattern, replacement) : value.replaceAll(pattern, replacement);
121
123
  }
122
124
  if (name === "replace")
123
- return value.replace(str(name, args, 0, node), str(name, args, 1, node));
124
- return value.replaceAll(str(name, args, 0, node), str(name, args, 1, node));
125
+ return value.replace(str(name, args, 0), str(name, args, 1));
126
+ return value.replaceAll(str(name, args, 0), str(name, args, 1));
125
127
  });
126
- methods(protos, protos.String, [
128
+ methods(builtins, builtins.String, [
127
129
  simple("toString", 0, (value) => value),
128
130
  simple("valueOf", 0, (value) => value),
129
131
  simple("toLowerCase", 0, (value) => value.toLowerCase()),
@@ -134,81 +136,101 @@ export const stringGlobal = (runner) => {
134
136
  simple("trimEnd", 0, (value) => value.trimEnd()),
135
137
  simple("trimRight", 0, (value) => value.trimEnd()),
136
138
  // Locale/options are deliberately unsupported; comparison uses the host default locale.
137
- simple("localeCompare", 1, (value, args, node) => value.localeCompare(str("localeCompare", args, 0, node))),
138
- simple("normalize", 0, (value, args, node) => {
139
- const form = optStr("normalize", args, 0, node);
139
+ simple("localeCompare", 1, (value, args) => value.localeCompare(str("localeCompare", args, 0))),
140
+ simple("normalize", 0, (value, args) => {
141
+ const form = optStr("normalize", args, 0);
140
142
  try {
141
143
  return value.normalize(form);
142
144
  }
143
145
  catch {
144
- throw rangeError(`String.normalize expects the form "NFC", "NFD", "NFKC", or "NFKD" (got ${JSON.stringify(form)}).`, node);
146
+ throw rangeError(`String.normalize expects the form "NFC", "NFD", "NFKC", or "NFKD" (got ${JSON.stringify(form)}).`);
145
147
  }
146
148
  }),
147
- simple("split", 2, (value, args, node) => {
148
- const wrap = (parts) => new ProgramArray(protos.Array, parts);
149
+ simple("split", 2, (value, args) => {
150
+ const wrap = (parts) => new Arr(builtins.Array, parts);
149
151
  // Native: an undefined separator returns the whole string, not a split on "undefined",
150
152
  // unless the limit truncates to zero.
151
- const requestedLimit = optNum("split", args, 1, node);
153
+ const requestedLimit = optNum("split", args, 1);
152
154
  if (args[0] === undefined) {
153
155
  return wrap(requestedLimit !== undefined && requestedLimit >>> 0 === 0 ? [] : [value]);
154
156
  }
155
- if (args[0] instanceof ProgramRegExp)
156
- return wrap(value.split(args[0].regex, requestedLimit));
157
- return wrap(value.split(str("split", args, 0, node), requestedLimit === undefined ? undefined : requestedLimit >>> 0));
157
+ const parts = args[0] instanceof RegExpObj
158
+ ? value.split(args[0].regex, requestedLimit)
159
+ : value.split(str("split", args, 0), requestedLimit === undefined ? undefined : requestedLimit >>> 0);
160
+ checkArrayLength(parts.length);
161
+ return wrap(parts);
158
162
  }),
159
- simple("slice", 2, (value, args, node) => value.slice(optNum("slice", args, 0, node), optNum("slice", args, 1, node))),
160
- simple("includes", 1, (value, args, node) => {
161
- rejectRegex("includes", args, node);
162
- return value.includes(str("includes", args, 0, node), optNum("includes", args, 1, node));
163
+ simple("slice", 2, (value, args) => value.slice(optNum("slice", args, 0), optNum("slice", args, 1))),
164
+ simple("includes", 1, (value, args) => {
165
+ rejectRegex("includes", args);
166
+ return value.includes(str("includes", args, 0), optNum("includes", args, 1));
163
167
  }),
164
- simple("startsWith", 1, (value, args, node) => {
165
- rejectRegex("startsWith", args, node);
166
- return value.startsWith(str("startsWith", args, 0, node), optNum("startsWith", args, 1, node));
168
+ simple("startsWith", 1, (value, args) => {
169
+ rejectRegex("startsWith", args);
170
+ return value.startsWith(str("startsWith", args, 0), optNum("startsWith", args, 1));
167
171
  }),
168
- simple("endsWith", 1, (value, args, node) => {
169
- rejectRegex("endsWith", args, node);
170
- return value.endsWith(str("endsWith", args, 0, node), optNum("endsWith", args, 1, node));
172
+ simple("endsWith", 1, (value, args) => {
173
+ rejectRegex("endsWith", args);
174
+ return value.endsWith(str("endsWith", args, 0), optNum("endsWith", args, 1));
171
175
  }),
172
- simple("indexOf", 1, (value, args, node) => value.indexOf(str("indexOf", args, 0, node), optNum("indexOf", args, 1, node))),
173
- simple("lastIndexOf", 1, (value, args, node) => value.lastIndexOf(str("lastIndexOf", args, 0, node), optNum("lastIndexOf", args, 1, node))),
176
+ simple("indexOf", 1, (value, args) => value.indexOf(str("indexOf", args, 0), optNum("indexOf", args, 1))),
177
+ simple("lastIndexOf", 1, (value, args) => value.lastIndexOf(str("lastIndexOf", args, 0), optNum("lastIndexOf", args, 1))),
174
178
  replace("replace"),
175
179
  replace("replaceAll"),
176
- simple("match", 1, (value, args, node) => {
177
- const pattern = toHostRegex(args[0], "match", node);
180
+ simple("match", 1, (value, args) => {
181
+ const pattern = toHostRegex(args[0], "match");
178
182
  const matched = value.match(pattern);
179
183
  if (matched === null)
180
184
  return null;
181
185
  // Preserve the own `index` and `groups` properties on non-global matches.
182
186
  if (pattern.global)
183
- return toProgram(protos, matched, "String.match result");
184
- return matchToValue(protos, matched);
187
+ return new Arr(builtins.Array, [...matched]);
188
+ return matchToValue(builtins, matched);
185
189
  }),
186
- simple("matchAll", 1, (value, args, node) => {
187
- const pattern = toHostRegex(args[0], "matchAll", node, "g");
190
+ simple("matchAll", 1, (value, args) => {
191
+ const pattern = toHostRegex(args[0], "matchAll", "g");
188
192
  if (!pattern.global) {
189
- throw new InterpreterRuntimeError(`String.matchAll requires a regular expression with the global (g) flag: write /${pattern.source}/${pattern.flags}g, or use String.match for a single match.`, node);
193
+ throw typeError(`String.matchAll requires a regular expression with the global (g) flag: write /${pattern.source}/${pattern.flags}g, or use String.match for a single match.`);
194
+ }
195
+ const matches = [];
196
+ for (const match of value.matchAll(pattern)) {
197
+ checkArrayLength(matches.length + 1);
198
+ matches.push(matchToValue(builtins, match));
190
199
  }
191
- return new ProgramArray(protos.Array, Array.from(value.matchAll(pattern), (match) => matchToValue(protos, match)));
200
+ return new Arr(builtins.Array, matches);
192
201
  }),
193
- simple("search", 1, (value, args, node) => value.search(toHostRegex(args[0], "search", node))),
194
- simple("repeat", 1, (value, args, node) => {
195
- const count = num("repeat", args, 0, node);
202
+ simple("search", 1, (value, args) => value.search(toHostRegex(args[0], "search"))),
203
+ simple("repeat", 1, (value, args) => {
204
+ const count = num("repeat", args, 0);
196
205
  if (!Number.isFinite(count) || count < 0) {
197
- throw rangeError("String.repeat expects a finite non-negative count.", node);
206
+ throw rangeError("String.repeat expects a finite non-negative count.");
198
207
  }
208
+ checkStringLength(value.length * count);
199
209
  return value.repeat(count);
200
210
  }),
201
- simple("padStart", 1, (value, args, node) => value.padStart(num("padStart", args, 0, node), optStr("padStart", args, 1, node))),
202
- simple("padEnd", 1, (value, args, node) => value.padEnd(num("padEnd", args, 0, node), optStr("padEnd", args, 1, node))),
203
- simple("charAt", 1, (value, args, node) => value.charAt(optNum("charAt", args, 0, node) ?? 0)),
204
- simple("at", 1, (value, args, node) => value.at(optNum("at", args, 0, node) ?? 0)),
205
- simple("substring", 2, (value, args, node) => value.substring(optNum("substring", args, 0, node) ?? 0, optNum("substring", args, 1, node))),
206
- simple("substr", 2, (value, args, node) => value.substr(optNum("substr", args, 0, node) ?? 0, optNum("substr", args, 1, node))),
211
+ simple("padStart", 1, (value, args) => {
212
+ const length = num("padStart", args, 0);
213
+ checkStringLength(length);
214
+ return value.padStart(length, optStr("padStart", args, 1));
215
+ }),
216
+ simple("padEnd", 1, (value, args) => {
217
+ const length = num("padEnd", args, 0);
218
+ checkStringLength(length);
219
+ return value.padEnd(length, optStr("padEnd", args, 1));
220
+ }),
221
+ simple("charAt", 1, (value, args) => value.charAt(optNum("charAt", args, 0) ?? 0)),
222
+ simple("at", 1, (value, args) => value.at(optNum("at", args, 0) ?? 0)),
223
+ simple("substring", 2, (value, args) => value.substring(optNum("substring", args, 0) ?? 0, optNum("substring", args, 1))),
224
+ simple("substr", 2, (value, args) => value.substr(optNum("substr", args, 0) ?? 0, optNum("substr", args, 1))),
207
225
  simple("isWellFormed", 0, (value) => value.isWellFormed()),
208
226
  simple("toWellFormed", 0, (value) => value.toWellFormed()),
209
- simple("charCodeAt", 1, (value, args, node) => value.charCodeAt(optNum("charCodeAt", args, 0, node) ?? 0)),
210
- simple("codePointAt", 1, (value, args, node) => value.codePointAt(optNum("codePointAt", args, 0, node) ?? 0)),
211
- simple("concat", 1, (value, args, node) => value.concat(...args.map((_, index) => str("concat", args, index, node)))),
227
+ simple("charCodeAt", 1, (value, args) => value.charCodeAt(optNum("charCodeAt", args, 0) ?? 0)),
228
+ simple("codePointAt", 1, (value, args) => value.codePointAt(optNum("codePointAt", args, 0) ?? 0)),
229
+ simple("concat", 1, (value, args) => {
230
+ const joined = value.concat(...args.map((_, index) => str("concat", args, index)));
231
+ checkStringLength(joined.length);
232
+ return joined;
233
+ }),
212
234
  ]);
213
235
  return string;
214
236
  };
@@ -1,8 +1,6 @@
1
- import type { Prototypes } from "../interpreter/intrinsics.js";
2
- import { type Runner } from "../interpreter/runner.js";
3
- export declare const uriArgument: (protos: Prototypes, value: unknown, label: string) => string;
1
+ import type { Interpreter } from "../interpreter/interpreter.js";
4
2
  type UriFunction = "encodeURI" | "encodeURIComponent" | "decodeURI" | "decodeURIComponent";
5
- export declare const uriGlobal: <R>(runner: Runner<R>, name: UriFunction) => import("../interpreter/objects.js").NativeFunction<R>;
6
- export declare const urlGlobal: <R>(runner: Runner<R>) => import("../interpreter/objects.js").NativeFunction<R>;
7
- export declare const urlSearchParamsGlobal: <R>(runner: Runner<R>) => import("../interpreter/objects.js").NativeFunction<R>;
3
+ export declare const uriGlobal: <R>(ctx: Interpreter<R>, name: UriFunction) => import("../interpreter/objects.js").Native<R>;
4
+ export declare const urlGlobal: <R>(ctx: Interpreter<R>) => import("../interpreter/objects.js").Native<R>;
5
+ export declare const urlSearchParamsGlobal: <R>(ctx: Interpreter<R>) => import("../interpreter/objects.js").Native<R>;
8
6
  export {};