import type { Expression, SpreadElement } from "./expression"; import type { GetterFunctionExpression, MethodFunctionExpression, SetterFunctionExpression, } from "./function"; import type { PublicKey } from "./key"; export type SpreadableObjectProperty = SpreadElement | ObjectProperty; export type ObjectProperty = | ValueObjectProperty | MethodObjectProperty | GetterObjectProperty | SetterObjectProperty; export type ValueObjectProperty = | NonComputedValueObjectProperty | ComputedValueObjectProperty; export type MethodObjectProperty = | NonComputedMethodObjectProperty | ComputedMethodObjectProperty; export type GetterObjectProperty = | NonComputedGetterObjectProperty | ComputedGetterObjectProperty; export type SetterObjectProperty = | NonComputedSetterObjectProperty | ComputedSetterObjectProperty; // object // export type ObjectExpression = X & { type: "ObjectExpression"; properties: Array>; }; // value // export type NonComputedValueObjectProperty = X & { type: "Property"; key: PublicKey; value: Expression; kind: "init"; method: false; shorthand: boolean; computed: false; }; export type ComputedValueObjectProperty = X & { type: "Property"; key: Expression; value: Expression; kind: "init"; method: false; shorthand: false; computed: true; }; // method // export type NonComputedMethodObjectProperty = X & { type: "Property"; key: PublicKey; value: MethodFunctionExpression; kind: "init"; method: true; shorthand: false; computed: false; }; export type ComputedMethodObjectProperty = X & { type: "Property"; key: Expression; value: MethodFunctionExpression; kind: "init"; method: true; shorthand: false; computed: true; }; // getter // export type NonComputedGetterObjectProperty = X & { type: "Property"; key: PublicKey; value: GetterFunctionExpression; kind: "get"; method: false; shorthand: false; computed: false; }; export type ComputedGetterObjectProperty = X & { type: "Property"; key: Expression; value: GetterFunctionExpression; kind: "get"; method: false; shorthand: false; computed: true; }; // setter // export type NonComputedSetterObjectProperty = X & { type: "Property"; key: PublicKey; value: SetterFunctionExpression; kind: "set"; method: false; shorthand: false; computed: false; }; export type ComputedSetterObjectProperty = X & { type: "Property"; key: Expression; value: SetterFunctionExpression; kind: "set"; method: false; shorthand: false; computed: true; };