@opencode/codemode 2.0.1 → 2.0.2

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 (61) hide show
  1. package/dist/data.d.ts +6 -5
  2. package/dist/data.js +44 -46
  3. package/dist/index.d.ts +0 -1
  4. package/dist/index.js +0 -1
  5. package/dist/interpreter/errors.d.ts +3 -4
  6. package/dist/interpreter/errors.js +40 -17
  7. package/dist/interpreter/execute.js +5 -3
  8. package/dist/interpreter/generators.d.ts +4 -0
  9. package/dist/interpreter/generators.js +25 -0
  10. package/dist/interpreter/globals.js +67 -46
  11. package/dist/interpreter/intrinsics.d.ts +8 -5
  12. package/dist/interpreter/intrinsics.js +59 -18
  13. package/dist/interpreter/model.d.ts +2 -32
  14. package/dist/interpreter/model.js +4 -38
  15. package/dist/interpreter/native.d.ts +19 -0
  16. package/dist/interpreter/native.js +40 -0
  17. package/dist/interpreter/objects.d.ts +105 -12
  18. package/dist/interpreter/objects.js +190 -66
  19. package/dist/interpreter/promises.d.ts +12 -13
  20. package/dist/interpreter/promises.js +52 -46
  21. package/dist/interpreter/references.d.ts +1 -0
  22. package/dist/interpreter/references.js +20 -33
  23. package/dist/interpreter/runner.d.ts +15 -13
  24. package/dist/interpreter/runner.js +19 -19
  25. package/dist/interpreter/runtime.d.ts +3 -3
  26. package/dist/interpreter/runtime.js +150 -314
  27. package/dist/stdlib/array.d.ts +4 -2
  28. package/dist/stdlib/array.js +423 -31
  29. package/dist/stdlib/collections.d.ts +3 -7
  30. package/dist/stdlib/collections.js +286 -114
  31. package/dist/stdlib/console.d.ts +3 -2
  32. package/dist/stdlib/console.js +35 -30
  33. package/dist/stdlib/date.d.ts +1 -7
  34. package/dist/stdlib/date.js +93 -188
  35. package/dist/stdlib/json.d.ts +2 -2
  36. package/dist/stdlib/json.js +24 -24
  37. package/dist/stdlib/math.d.ts +2 -2
  38. package/dist/stdlib/math.js +96 -76
  39. package/dist/stdlib/number.d.ts +3 -4
  40. package/dist/stdlib/number.js +94 -59
  41. package/dist/stdlib/object.d.ts +4 -4
  42. package/dist/stdlib/object.js +123 -49
  43. package/dist/stdlib/regexp.d.ts +6 -8
  44. package/dist/stdlib/regexp.js +71 -63
  45. package/dist/stdlib/string.d.ts +2 -2
  46. package/dist/stdlib/string.js +213 -50
  47. package/dist/stdlib/url.d.ts +5 -13
  48. package/dist/stdlib/url.js +196 -96
  49. package/dist/stdlib/value.d.ts +5 -4
  50. package/dist/stdlib/value.js +16 -16
  51. package/dist/stdlib/web.d.ts +4 -4
  52. package/dist/stdlib/web.js +8 -7
  53. package/dist/tool-runtime.d.ts +2 -1
  54. package/dist/tool-runtime.js +2 -2
  55. package/package.json +1 -1
  56. package/dist/interpreter/host.d.ts +0 -41
  57. package/dist/interpreter/host.js +0 -44
  58. package/dist/interpreter/methods.d.ts +0 -4
  59. package/dist/interpreter/methods.js +0 -837
  60. package/dist/values.d.ts +0 -37
  61. package/dist/values.js +0 -56
@@ -1,4 +1,5 @@
1
- import { ProgramError, ProgramObject, set } from "./objects.js";
1
+ import { Effect } from "effect";
2
+ import { define, hidden, NativeFunction, ProgramArray, ProgramError, ProgramObject } from "./objects.js";
2
3
  export const errorTypes = [
3
4
  "Error",
4
5
  "TypeError",
@@ -10,32 +11,72 @@ export const errorTypes = [
10
11
  "AggregateError",
11
12
  ];
12
13
  export const isErrorType = (name) => errorTypes.includes(name);
14
+ const builtins = [
15
+ "Object",
16
+ "Function",
17
+ "Array",
18
+ "String",
19
+ "Number",
20
+ "Boolean",
21
+ "Date",
22
+ "RegExp",
23
+ "Map",
24
+ "Set",
25
+ "URL",
26
+ "URLSearchParams",
27
+ "Promise",
28
+ "Iterator",
29
+ "AsyncIterator",
30
+ "Generator",
31
+ "AsyncGenerator",
32
+ ];
13
33
  export const createErrorValue = (prototype, message) => {
14
34
  const value = new ProgramError(prototype);
15
35
  if (message !== undefined)
16
- set(value, "message", message);
36
+ define(value, "message", message, hidden);
17
37
  return value;
18
38
  };
19
- export const createIntrinsics = () => {
20
- const error = new ProgramObject();
21
- set(error, "name", "Error");
22
- set(error, "message", "");
39
+ export const createPrototypes = () => {
40
+ const object = new ProgramObject(null);
41
+ // Function.prototype is itself callable and returns undefined.
42
+ const fn = new NativeFunction(object, { name: "", call: () => Effect.undefined });
43
+ const plain = () => new ProgramObject(object);
44
+ const error = plain();
45
+ define(error, "name", "Error", hidden);
46
+ define(error, "message", "", hidden);
23
47
  const derived = (type) => {
24
48
  const proto = new ProgramObject(error);
25
- set(proto, "name", type);
26
- set(proto, "message", "");
49
+ define(proto, "name", type, hidden);
50
+ define(proto, "message", "", hidden);
27
51
  return proto;
28
52
  };
53
+ const iterator = plain();
54
+ const asyncIterator = plain();
29
55
  return {
30
- errors: {
31
- Error: error,
32
- TypeError: derived("TypeError"),
33
- RangeError: derived("RangeError"),
34
- SyntaxError: derived("SyntaxError"),
35
- ReferenceError: derived("ReferenceError"),
36
- EvalError: derived("EvalError"),
37
- URIError: derived("URIError"),
38
- AggregateError: derived("AggregateError"),
39
- },
56
+ Object: object,
57
+ Function: fn,
58
+ Array: new ProgramArray(object),
59
+ String: plain(),
60
+ Number: plain(),
61
+ Boolean: plain(),
62
+ Date: plain(),
63
+ RegExp: plain(),
64
+ Map: plain(),
65
+ Set: plain(),
66
+ URL: plain(),
67
+ URLSearchParams: plain(),
68
+ Promise: plain(),
69
+ Iterator: iterator,
70
+ AsyncIterator: asyncIterator,
71
+ Generator: new ProgramObject(iterator),
72
+ AsyncGenerator: new ProgramObject(asyncIterator),
73
+ Error: error,
74
+ TypeError: derived("TypeError"),
75
+ RangeError: derived("RangeError"),
76
+ SyntaxError: derived("SyntaxError"),
77
+ ReferenceError: derived("ReferenceError"),
78
+ EvalError: derived("EvalError"),
79
+ URIError: derived("URIError"),
80
+ AggregateError: derived("AggregateError"),
40
81
  };
41
82
  };
@@ -1,9 +1,6 @@
1
1
  import type { Node } from "acorn";
2
2
  import type { ErrorType } from "./intrinsics.js";
3
- import type { Effect } from "effect";
4
3
  import type { DiagnosticKind } from "../codemode.js";
5
- import type { ProgramObject } from "./objects.js";
6
- import type { Values } from "../values.js";
7
4
  /** Any parsed node; the interpreter narrows on `type` and reads `loc` for diagnostics. */
8
5
  export type AstNode = Node;
9
6
  export type Binding = {
@@ -23,39 +20,10 @@ export type StatementResult = {
23
20
  kind: "continue";
24
21
  label?: string;
25
22
  };
26
- export type MemberReference = {
27
- target: ProgramObject | Values.RegExp | Values.URL;
28
- key: PropertyKey;
29
- };
30
23
  export type GeneratorRequestKind = "next" | "return" | "throw";
31
- export declare class CodeModeGenerator {
32
- readonly asynchronous: boolean;
33
- readonly request: (kind: GeneratorRequestKind, value: unknown, node: AstNode) => Effect.Effect<unknown, unknown, unknown>;
34
- constructor(asynchronous: boolean, request: (kind: GeneratorRequestKind, value: unknown, node: AstNode) => Effect.Effect<unknown, unknown, unknown>);
35
- }
36
- export declare class GeneratorMethodReference {
37
- readonly generator: CodeModeGenerator;
38
- readonly kind: GeneratorRequestKind | "iterator";
39
- constructor(generator: CodeModeGenerator, kind: GeneratorRequestKind | "iterator");
40
- }
41
- export declare class IntrinsicReference {
42
- readonly receiver: unknown;
43
- readonly name: string;
44
- constructor(receiver: unknown, name: string);
45
- }
46
- export declare class ComputedValue {
47
- readonly value: unknown;
48
- constructor(value: unknown);
49
- }
50
24
  export declare const AsyncIteratorSymbol: unique symbol;
51
25
  export declare const IteratorSymbol: unique symbol;
52
26
  export declare const IteratorSymbols: readonly [typeof AsyncIteratorSymbol, typeof IteratorSymbol];
53
- export type PromiseInstanceMethodName = "then" | "catch" | "finally";
54
- export declare class PromiseInstanceMethodReference {
55
- readonly promise: Values.Promise;
56
- readonly name: PromiseInstanceMethodName;
57
- constructor(promise: Values.Promise, name: PromiseInstanceMethodName);
58
- }
59
27
  export declare class ProgramThrow {
60
28
  readonly value: unknown;
61
29
  constructor(value: unknown);
@@ -75,6 +43,8 @@ export declare class InterpreterRuntimeError extends Error {
75
43
  /** The JS error class a program sees when it catches this failure. */
76
44
  type?: ErrorType);
77
45
  }
46
+ /** Attaches a source location to a failure raised where none was known, such as inside a property accessor. */
47
+ export declare const locate: (error: unknown, node: AstNode) => unknown;
78
48
  export declare const rangeError: (message: string, node?: AstNode) => InterpreterRuntimeError;
79
49
  export declare const referenceError: (message: string, node?: AstNode) => InterpreterRuntimeError;
80
50
  export declare const syntaxError: (message: string, node?: AstNode) => InterpreterRuntimeError;
@@ -1,44 +1,6 @@
1
- export class CodeModeGenerator {
2
- asynchronous;
3
- request;
4
- constructor(asynchronous, request) {
5
- this.asynchronous = asynchronous;
6
- this.request = request;
7
- }
8
- }
9
- export class GeneratorMethodReference {
10
- generator;
11
- kind;
12
- constructor(generator, kind) {
13
- this.generator = generator;
14
- this.kind = kind;
15
- }
16
- }
17
- export class IntrinsicReference {
18
- receiver;
19
- name;
20
- constructor(receiver, name) {
21
- this.receiver = receiver;
22
- this.name = name;
23
- }
24
- }
25
- export class ComputedValue {
26
- value;
27
- constructor(value) {
28
- this.value = value;
29
- }
30
- }
31
1
  export const AsyncIteratorSymbol = Symbol("codemode.async-iterator");
32
2
  export const IteratorSymbol = Symbol("codemode.iterator");
33
3
  export const IteratorSymbols = [AsyncIteratorSymbol, IteratorSymbol];
34
- export class PromiseInstanceMethodReference {
35
- promise;
36
- name;
37
- constructor(promise, name) {
38
- this.promise = promise;
39
- this.name = name;
40
- }
41
- }
42
4
  export class ProgramThrow {
43
5
  value;
44
6
  constructor(value) {
@@ -69,6 +31,10 @@ export class InterpreterRuntimeError extends Error {
69
31
  this.node = node;
70
32
  }
71
33
  }
34
+ /** Attaches a source location to a failure raised where none was known, such as inside a property accessor. */
35
+ export const locate = (error, node) => error instanceof InterpreterRuntimeError && error.node === undefined
36
+ ? new InterpreterRuntimeError(error.message, node, error.kind, error.suggestions, error.type)
37
+ : error;
72
38
  const failure = (type) => (message, node) => new InterpreterRuntimeError(message, node, "ExecutionFailure", undefined, type);
73
39
  export const rangeError = failure("RangeError");
74
40
  export const referenceError = failure("ReferenceError");
@@ -0,0 +1,19 @@
1
+ import { Effect } from "effect";
2
+ import type { Prototypes } from "./intrinsics.js";
3
+ import { type AstNode } from "./model.js";
4
+ import { type Callable, NativeFunction, type NativeOptions, ProgramObject } from "./objects.js";
5
+ /** A native function body: a plain value, a thrown `InterpreterRuntimeError`, or an Effect. */
6
+ export type Impl = (thisValue: unknown, args: Array<unknown>, node: AstNode) => unknown;
7
+ export declare const native: <R>(protos: Prototypes, options: NativeOptions<R>) => NativeFunction<R>;
8
+ export declare const fn: <R>(protos: Prototypes, name: string, length: number, impl: Impl) => NativeFunction<R>;
9
+ export type Method = readonly [name: string, length: number, impl: Impl];
10
+ export declare const methods: (protos: Prototypes, target: ProgramObject, table: ReadonlyArray<Method>) => void;
11
+ export declare const constants: (target: ProgramObject, table: Record<string, unknown>) => void;
12
+ /** A constructor wired to its prototype: `C.prototype === proto` and `proto.constructor === C`. */
13
+ export declare const constructor: <R>(protos: Prototypes, proto: ProgramObject, options: NativeOptions<R>) => NativeFunction<R>;
14
+ /** The `call` of a constructor that JS requires to be invoked with `new`. */
15
+ export declare const requiresNew: (name: string) => (_: unknown, __: Array<unknown>, node: AstNode) => Effect.Effect<never, unknown, never>;
16
+ /** The instance prototype for `new` via `newTarget.prototype`, falling back to the built-in's own. */
17
+ export declare const prototypeFrom: (newTarget: Callable, fallback: ProgramObject) => ProgramObject;
18
+ /** Narrows a method receiver to the built-in it belongs to, or throws the TypeError JS would. */
19
+ export declare const receiver: <T extends ProgramObject>(cls: abstract new (...args: never) => T, thisValue: unknown, method: string, node?: AstNode) => T;
@@ -0,0 +1,40 @@
1
+ import { Effect } from "effect";
2
+ import { InterpreterRuntimeError } from "./model.js";
3
+ import { define, frozen, hidden, NativeFunction, ProgramObject } from "./objects.js";
4
+ import { describeValue } from "./references.js";
5
+ const lift = (impl) => (thisValue, args, node) => Effect.suspend(() => {
6
+ const result = impl(thisValue, args, node);
7
+ return Effect.isEffect(result) ? result : Effect.succeed(result);
8
+ });
9
+ export const native = (protos, options) => new NativeFunction(protos.Function, options);
10
+ export const fn = (protos, name, length, impl) => native(protos, { name, length, call: lift(impl) });
11
+ export const methods = (protos, target, table) => {
12
+ for (const [name, length, impl] of table)
13
+ define(target, name, fn(protos, name, length, impl), hidden);
14
+ };
15
+ export const constants = (target, table) => {
16
+ for (const [name, value] of Object.entries(table))
17
+ define(target, name, value, frozen);
18
+ };
19
+ /** A constructor wired to its prototype: `C.prototype === proto` and `proto.constructor === C`. */
20
+ export const constructor = (protos, proto, options) => {
21
+ const ctor = native(protos, options);
22
+ define(ctor, "prototype", proto, frozen);
23
+ define(proto, "constructor", ctor, hidden);
24
+ return ctor;
25
+ };
26
+ /** The `call` of a constructor that JS requires to be invoked with `new`. */
27
+ export const requiresNew = (name) => (_, __, node) => Effect.sync(() => {
28
+ throw new InterpreterRuntimeError(`Constructor ${name} requires 'new'.`, node);
29
+ });
30
+ /** The instance prototype for `new` via `newTarget.prototype`, falling back to the built-in's own. */
31
+ export const prototypeFrom = (newTarget, fallback) => {
32
+ const proto = newTarget.props.get("prototype");
33
+ return proto !== undefined && "value" in proto && proto.value instanceof ProgramObject ? proto.value : fallback;
34
+ };
35
+ /** Narrows a method receiver to the built-in it belongs to, or throws the TypeError JS would. */
36
+ export const receiver = (cls, thisValue, method, node) => {
37
+ if (thisValue instanceof cls)
38
+ return thisValue;
39
+ throw new InterpreterRuntimeError(`${method} called on incompatible receiver ${describeValue(thisValue)}.`, node);
40
+ };
@@ -1,37 +1,130 @@
1
1
  import type { BlockStatement, Expression, Pattern } from "acorn";
2
- import { type Binding } from "./model.js";
2
+ import type { Effect, Fiber } from "effect";
3
+ import { type AstNode, type Binding, type GeneratorRequestKind } from "./model.js";
4
+ /** Property attributes, as in a JS property descriptor. */
5
+ export type Attributes = {
6
+ readonly writable: boolean;
7
+ readonly enumerable: boolean;
8
+ readonly configurable: boolean;
9
+ };
10
+ export type Getter = (receiver: unknown) => unknown;
11
+ export type Setter = (receiver: unknown, value: unknown) => void;
12
+ /** One own property: a data slot or a native accessor pair. */
13
+ export type Slot = {
14
+ value: unknown;
15
+ writable: boolean;
16
+ enumerable: boolean;
17
+ configurable: boolean;
18
+ } | {
19
+ get: Getter | undefined;
20
+ set: Setter | undefined;
21
+ enumerable: boolean;
22
+ configurable: boolean;
23
+ };
24
+ /** Ordinary assignment: writable, enumerable, configurable. */
25
+ export declare const data: Attributes;
26
+ /** Built-in methods and `constructor`: writable and configurable but hidden from enumeration. */
27
+ export declare const hidden: Attributes;
28
+ /** Function `name` and `length`: read-only but deletable. */
29
+ export declare const readonly: Attributes;
30
+ /** Constants such as `Math.PI` and a constructor's `prototype`. */
31
+ export declare const frozen: Attributes;
3
32
  /** An object owned by the program: own properties plus a prototype link. */
4
33
  export declare class ProgramObject {
5
34
  proto: ProgramObject | null;
6
- readonly props: Map<PropertyKey, unknown>;
7
- constructor(proto?: ProgramObject | null);
35
+ readonly props: Map<string | symbol, Slot>;
36
+ constructor(proto: ProgramObject | null);
8
37
  }
9
38
  export declare class ProgramArray extends ProgramObject {
10
39
  readonly items: Array<unknown>;
11
- constructor(items?: Array<unknown>);
40
+ constructor(proto: ProgramObject, items?: Array<unknown>);
12
41
  }
13
42
  /** An object with the [[ErrorData]] slot: what `Error.prototype.toString` and the host boundary recognize as an error. */
14
43
  export declare class ProgramError extends ProgramObject {
15
44
  }
16
- export declare class ProgramFunction extends ProgramObject {
17
- readonly name: string;
45
+ export declare abstract class Callable extends ProgramObject {
46
+ constructor(proto: ProgramObject, name: string, length: number);
47
+ }
48
+ export declare class ProgramFunction extends Callable {
18
49
  readonly parameters: ReadonlyArray<Pattern>;
19
50
  readonly body: BlockStatement | Expression;
20
51
  readonly capturedScopes: ReadonlyArray<Map<string, Binding>>;
21
52
  readonly async: boolean;
22
53
  readonly generator: boolean;
23
- readonly length: number;
24
- constructor(name: string, parameters: ReadonlyArray<Pattern>, body: BlockStatement | Expression, capturedScopes: ReadonlyArray<Map<string, Binding>>, async: boolean, generator: boolean);
54
+ constructor(proto: ProgramObject, name: string, parameters: ReadonlyArray<Pattern>, body: BlockStatement | Expression, capturedScopes: ReadonlyArray<Map<string, Binding>>, async: boolean, generator: boolean);
55
+ }
56
+ export type NativeCall<R> = (thisValue: unknown, args: Array<unknown>, node: AstNode) => Effect.Effect<unknown, unknown, R>;
57
+ export type NativeConstruct<R> = (args: Array<unknown>, newTarget: Callable, node: AstNode) => Effect.Effect<unknown, unknown, R>;
58
+ export type NativeOptions<R> = {
59
+ readonly name: string;
60
+ readonly length?: number;
61
+ readonly call: NativeCall<R>;
62
+ /** `new name(...)`; without it the function is not a constructor. */
63
+ readonly construct?: NativeConstruct<R>;
64
+ /** Whether callback sites (array methods, replacers, promise reactions) admit this function. Defaults to true. */
65
+ readonly callback?: boolean;
66
+ };
67
+ export declare class NativeFunction<R = never> extends Callable {
68
+ readonly call: NativeCall<R>;
69
+ readonly construct: NativeConstruct<R> | undefined;
70
+ readonly callback: boolean;
71
+ constructor(proto: ProgramObject, options: NativeOptions<R>);
72
+ }
73
+ export declare class ProgramPromise extends ProgramObject {
74
+ readonly fiber: Fiber.Fiber<unknown, unknown>;
75
+ constructor(proto: ProgramObject, fiber: Fiber.Fiber<unknown, unknown>);
76
+ }
77
+ export declare class ProgramGenerator extends ProgramObject {
78
+ readonly asynchronous: boolean;
79
+ readonly request: (kind: GeneratorRequestKind, value: unknown, node: AstNode) => Effect.Effect<unknown, unknown, unknown>;
80
+ constructor(proto: ProgramObject, asynchronous: boolean, request: (kind: GeneratorRequestKind, value: unknown, node: AstNode) => Effect.Effect<unknown, unknown, unknown>);
81
+ }
82
+ export declare class ProgramDate extends ProgramObject {
83
+ time: number;
84
+ constructor(proto: ProgramObject, time: number);
25
85
  }
86
+ export declare class ProgramRegExp extends ProgramObject {
87
+ readonly regex: RegExp;
88
+ constructor(proto: ProgramObject, pattern: string, flags: string);
89
+ }
90
+ export declare class ProgramMap extends ProgramObject {
91
+ readonly map: Map<unknown, unknown>;
92
+ }
93
+ export declare class ProgramSet extends ProgramObject {
94
+ readonly set: Set<unknown>;
95
+ }
96
+ export declare class ProgramURLSearchParams extends ProgramObject {
97
+ readonly params: URLSearchParams;
98
+ constructor(proto: ProgramObject, params: URLSearchParams);
99
+ }
100
+ export declare class ProgramURL extends ProgramObject {
101
+ readonly url: URL;
102
+ readonly searchParams: ProgramURLSearchParams;
103
+ constructor(proto: ProgramObject, searchParamsProto: ProgramObject, url: URL);
104
+ }
105
+ /** Built-in objects that wrap a host value; data-like, but never plain data. */
106
+ export declare const isWrapper: (value: unknown) => value is ProgramDate | ProgramRegExp | ProgramMap | ProgramSet | ProgramURL | ProgramURLSearchParams;
26
107
  export declare const parseArrayIndex: (key: string | number) => number | undefined;
108
+ /** The own property under `key`, including an array's live indexes and `length`. */
109
+ export declare const own: (target: ProgramObject, key: PropertyKey) => Slot | undefined;
27
110
  export declare const hasOwn: (target: ProgramObject, key: PropertyKey) => boolean;
28
111
  export declare const getOwn: (target: ProgramObject, key: PropertyKey) => unknown;
29
- export declare const get: (target: ProgramObject, key: PropertyKey) => unknown;
30
- export declare const hasPrototype: (value: unknown, proto: ProgramObject) => boolean;
112
+ /** [[Get]]: walks the prototype chain; accessors see `receiver`, which is the primitive for wrapper prototypes. */
113
+ export declare const get: (target: ProgramObject, key: PropertyKey, receiver?: unknown) => unknown;
31
114
  export declare const has: (target: ProgramObject, key: PropertyKey) => boolean;
115
+ export declare const hasPrototype: (value: unknown, proto: ProgramObject) => boolean;
116
+ /** [[Set]]: an inherited setter or read-only property decides before an own data property is created. */
32
117
  export declare const set: (target: ProgramObject, key: PropertyKey, value: unknown) => boolean;
118
+ /** [[DefineOwnProperty]] for a data property, ignoring the chain. */
119
+ export declare const define: (target: ProgramObject, key: PropertyKey, value: unknown, attrs?: Attributes) => void;
120
+ export declare const defineAccessor: (target: ProgramObject, key: PropertyKey, get: Getter, set?: Setter) => void;
33
121
  export declare const remove: (target: ProgramObject, key: PropertyKey) => boolean;
34
122
  export declare const ownKeys: (target: ProgramObject) => Array<string | symbol>;
35
- export declare const ownEntries: (target: ProgramObject) => Array<[string, unknown]>;
36
- export declare const record: (entries: Record<string, unknown>) => ProgramObject;
123
+ /** Own enumerable keys, including the iterator symbols; what spread and `Object.assign` copy. */
124
+ export declare const enumerableKeys: (target: ProgramObject) => Array<string | symbol>;
125
+ /** Own enumerable string keys: `Object.keys`. */
126
+ export declare const keys: (target: ProgramObject) => Array<string>;
127
+ /** Own enumerable string entries: `Object.entries` and serialization. */
128
+ export declare const entries: (target: ProgramObject) => Array<[string, unknown]>;
129
+ export declare const record: (proto: ProgramObject, fields: Record<string, unknown>) => ProgramObject;
37
130
  export declare const assign: (target: ProgramObject, source: ProgramObject, skip?: ReadonlySet<PropertyKey>) => void;