@blade-hq/agent-client 1.1.1 → 1.1.3
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.
- package/README.md +48 -25
- package/dist/blade-client.d.ts +2 -14
- package/dist/index.d.ts +5 -2
- package/dist/index.js +212 -106
- package/dist/index.js.map +1 -1
- package/dist/resources/models.d.ts +15 -0
- package/dist/resources/sessions.d.ts +8 -1
- package/dist/session/agent-session.d.ts +10 -0
- package/dist/session/definition.d.ts +49 -0
- package/dist/shared/projection/helpers.d.ts +1 -1
- package/dist/types/rest.d.ts +378 -10
- package/dist/version.d.ts +4 -42
- package/node_modules/@ark/schema/LICENSE +7 -0
- package/node_modules/@ark/schema/README.md +18 -0
- package/node_modules/@ark/schema/out/config.d.ts +58 -0
- package/node_modules/@ark/schema/out/config.js +95 -0
- package/node_modules/@ark/schema/out/constraint.d.ts +67 -0
- package/node_modules/@ark/schema/out/constraint.js +136 -0
- package/node_modules/@ark/schema/out/generic.d.ts +73 -0
- package/node_modules/@ark/schema/out/generic.js +76 -0
- package/node_modules/@ark/schema/out/index.d.ts +47 -0
- package/node_modules/@ark/schema/out/index.js +47 -0
- package/node_modules/@ark/schema/out/intrinsic.d.ts +24 -0
- package/node_modules/@ark/schema/out/intrinsic.js +56 -0
- package/node_modules/@ark/schema/out/kinds.d.ts +73 -0
- package/node_modules/@ark/schema/out/kinds.js +71 -0
- package/node_modules/@ark/schema/out/module.d.ts +24 -0
- package/node_modules/@ark/schema/out/module.js +15 -0
- package/node_modules/@ark/schema/out/node.d.ts +154 -0
- package/node_modules/@ark/schema/out/node.js +438 -0
- package/node_modules/@ark/schema/out/parse.d.ts +52 -0
- package/node_modules/@ark/schema/out/parse.js +215 -0
- package/node_modules/@ark/schema/out/predicate.d.ts +52 -0
- package/node_modules/@ark/schema/out/predicate.js +63 -0
- package/node_modules/@ark/schema/out/refinements/after.d.ts +41 -0
- package/node_modules/@ark/schema/out/refinements/after.js +35 -0
- package/node_modules/@ark/schema/out/refinements/before.d.ts +41 -0
- package/node_modules/@ark/schema/out/refinements/before.js +41 -0
- package/node_modules/@ark/schema/out/refinements/divisor.d.ts +43 -0
- package/node_modules/@ark/schema/out/refinements/divisor.js +58 -0
- package/node_modules/@ark/schema/out/refinements/exactLength.d.ts +49 -0
- package/node_modules/@ark/schema/out/refinements/exactLength.js +55 -0
- package/node_modules/@ark/schema/out/refinements/kinds.d.ts +34 -0
- package/node_modules/@ark/schema/out/refinements/kinds.js +25 -0
- package/node_modules/@ark/schema/out/refinements/max.d.ts +37 -0
- package/node_modules/@ark/schema/out/refinements/max.js +45 -0
- package/node_modules/@ark/schema/out/refinements/maxLength.d.ts +40 -0
- package/node_modules/@ark/schema/out/refinements/maxLength.js +49 -0
- package/node_modules/@ark/schema/out/refinements/min.d.ts +37 -0
- package/node_modules/@ark/schema/out/refinements/min.js +39 -0
- package/node_modules/@ark/schema/out/refinements/minLength.d.ts +40 -0
- package/node_modules/@ark/schema/out/refinements/minLength.js +47 -0
- package/node_modules/@ark/schema/out/refinements/pattern.d.ts +43 -0
- package/node_modules/@ark/schema/out/refinements/pattern.js +52 -0
- package/node_modules/@ark/schema/out/refinements/range.d.ts +106 -0
- package/node_modules/@ark/schema/out/refinements/range.js +103 -0
- package/node_modules/@ark/schema/out/roots/alias.d.ts +45 -0
- package/node_modules/@ark/schema/out/roots/alias.js +115 -0
- package/node_modules/@ark/schema/out/roots/basis.d.ts +12 -0
- package/node_modules/@ark/schema/out/roots/basis.js +26 -0
- package/node_modules/@ark/schema/out/roots/domain.d.ts +45 -0
- package/node_modules/@ark/schema/out/roots/domain.js +72 -0
- package/node_modules/@ark/schema/out/roots/intersection.d.ts +98 -0
- package/node_modules/@ark/schema/out/roots/intersection.js +292 -0
- package/node_modules/@ark/schema/out/roots/morph.d.ts +62 -0
- package/node_modules/@ark/schema/out/roots/morph.js +159 -0
- package/node_modules/@ark/schema/out/roots/proto.d.ts +53 -0
- package/node_modules/@ark/schema/out/roots/proto.js +101 -0
- package/node_modules/@ark/schema/out/roots/root.d.ts +145 -0
- package/node_modules/@ark/schema/out/roots/root.js +455 -0
- package/node_modules/@ark/schema/out/roots/union.d.ts +99 -0
- package/node_modules/@ark/schema/out/roots/union.js +718 -0
- package/node_modules/@ark/schema/out/roots/unit.d.ts +41 -0
- package/node_modules/@ark/schema/out/roots/unit.js +86 -0
- package/node_modules/@ark/schema/out/roots/utils.d.ts +3 -0
- package/node_modules/@ark/schema/out/roots/utils.js +6 -0
- package/node_modules/@ark/schema/out/scope.d.ts +158 -0
- package/node_modules/@ark/schema/out/scope.js +481 -0
- package/node_modules/@ark/schema/out/shared/compile.d.ts +62 -0
- package/node_modules/@ark/schema/out/shared/compile.js +145 -0
- package/node_modules/@ark/schema/out/shared/declare.d.ts +80 -0
- package/node_modules/@ark/schema/out/shared/declare.js +1 -0
- package/node_modules/@ark/schema/out/shared/disjoint.d.ts +41 -0
- package/node_modules/@ark/schema/out/shared/disjoint.js +65 -0
- package/node_modules/@ark/schema/out/shared/errors.d.ts +145 -0
- package/node_modules/@ark/schema/out/shared/errors.js +252 -0
- package/node_modules/@ark/schema/out/shared/implement.d.ts +151 -0
- package/node_modules/@ark/schema/out/shared/implement.js +98 -0
- package/node_modules/@ark/schema/out/shared/intersections.d.ts +10 -0
- package/node_modules/@ark/schema/out/shared/intersections.js +132 -0
- package/node_modules/@ark/schema/out/shared/jsonSchema.d.ts +93 -0
- package/node_modules/@ark/schema/out/shared/jsonSchema.js +1 -0
- package/node_modules/@ark/schema/out/shared/registry.d.ts +7 -0
- package/node_modules/@ark/schema/out/shared/registry.js +10 -0
- package/node_modules/@ark/schema/out/shared/standardSchema.d.ts +122 -0
- package/node_modules/@ark/schema/out/shared/standardSchema.js +2 -0
- package/node_modules/@ark/schema/out/shared/toJsonSchema.d.ts +139 -0
- package/node_modules/@ark/schema/out/shared/toJsonSchema.js +40 -0
- package/node_modules/@ark/schema/out/shared/traversal.d.ts +117 -0
- package/node_modules/@ark/schema/out/shared/traversal.js +226 -0
- package/node_modules/@ark/schema/out/shared/utils.d.ts +34 -0
- package/node_modules/@ark/schema/out/shared/utils.js +8 -0
- package/node_modules/@ark/schema/out/structure/index.d.ts +46 -0
- package/node_modules/@ark/schema/out/structure/index.js +89 -0
- package/node_modules/@ark/schema/out/structure/optional.d.ts +49 -0
- package/node_modules/@ark/schema/out/structure/optional.js +127 -0
- package/node_modules/@ark/schema/out/structure/prop.d.ts +45 -0
- package/node_modules/@ark/schema/out/structure/prop.js +85 -0
- package/node_modules/@ark/schema/out/structure/required.d.ts +39 -0
- package/node_modules/@ark/schema/out/structure/required.js +38 -0
- package/node_modules/@ark/schema/out/structure/sequence.d.ts +110 -0
- package/node_modules/@ark/schema/out/structure/sequence.js +521 -0
- package/node_modules/@ark/schema/out/structure/shared.d.ts +4 -0
- package/node_modules/@ark/schema/out/structure/shared.js +4 -0
- package/node_modules/@ark/schema/out/structure/structure.d.ts +113 -0
- package/node_modules/@ark/schema/out/structure/structure.js +747 -0
- package/node_modules/@ark/schema/package.json +51 -0
- package/node_modules/@ark/util/LICENSE +7 -0
- package/node_modules/@ark/util/out/arrays.d.ts +166 -0
- package/node_modules/@ark/util/out/arrays.js +147 -0
- package/node_modules/@ark/util/out/clone.d.ts +4 -0
- package/node_modules/@ark/util/out/clone.js +33 -0
- package/node_modules/@ark/util/out/describe.d.ts +25 -0
- package/node_modules/@ark/util/out/describe.js +1 -0
- package/node_modules/@ark/util/out/domain.d.ts +48 -0
- package/node_modules/@ark/util/out/domain.js +25 -0
- package/node_modules/@ark/util/out/errors.d.ts +29 -0
- package/node_modules/@ark/util/out/errors.js +17 -0
- package/node_modules/@ark/util/out/flatMorph.d.ts +41 -0
- package/node_modules/@ark/util/out/flatMorph.js +24 -0
- package/node_modules/@ark/util/out/functions.d.ts +33 -0
- package/node_modules/@ark/util/out/functions.js +53 -0
- package/node_modules/@ark/util/out/generics.d.ts +59 -0
- package/node_modules/@ark/util/out/generics.js +5 -0
- package/node_modules/@ark/util/out/get.d.ts +9 -0
- package/node_modules/@ark/util/out/get.js +7 -0
- package/node_modules/@ark/util/out/hkt.d.ts +27 -0
- package/node_modules/@ark/util/out/hkt.js +5 -0
- package/node_modules/@ark/util/out/index.d.ts +24 -0
- package/node_modules/@ark/util/out/index.js +24 -0
- package/node_modules/@ark/util/out/intersections.d.ts +50 -0
- package/node_modules/@ark/util/out/intersections.js +1 -0
- package/node_modules/@ark/util/out/isomorphic.d.ts +5 -0
- package/node_modules/@ark/util/out/isomorphic.js +19 -0
- package/node_modules/@ark/util/out/keys.d.ts +18 -0
- package/node_modules/@ark/util/out/keys.js +1 -0
- package/node_modules/@ark/util/out/lazily.d.ts +1 -0
- package/node_modules/@ark/util/out/lazily.js +16 -0
- package/node_modules/@ark/util/out/numbers.d.ts +72 -0
- package/node_modules/@ark/util/out/numbers.js +138 -0
- package/node_modules/@ark/util/out/objectKinds.d.ts +205 -0
- package/node_modules/@ark/util/out/objectKinds.js +150 -0
- package/node_modules/@ark/util/out/path.d.ts +22 -0
- package/node_modules/@ark/util/out/path.js +65 -0
- package/node_modules/@ark/util/out/primitive.d.ts +16 -0
- package/node_modules/@ark/util/out/primitive.js +3 -0
- package/node_modules/@ark/util/out/records.d.ts +183 -0
- package/node_modules/@ark/util/out/records.js +63 -0
- package/node_modules/@ark/util/out/registry.d.ts +21 -0
- package/node_modules/@ark/util/out/registry.js +49 -0
- package/node_modules/@ark/util/out/scanner.d.ts +44 -0
- package/node_modules/@ark/util/out/scanner.js +87 -0
- package/node_modules/@ark/util/out/serialize.d.ts +34 -0
- package/node_modules/@ark/util/out/serialize.js +150 -0
- package/node_modules/@ark/util/out/strings.d.ts +33 -0
- package/node_modules/@ark/util/out/strings.js +59 -0
- package/node_modules/@ark/util/out/traits.d.ts +89 -0
- package/node_modules/@ark/util/out/traits.js +75 -0
- package/node_modules/@ark/util/out/unionToTuple.d.ts +14 -0
- package/node_modules/@ark/util/out/unionToTuple.js +1 -0
- package/node_modules/@ark/util/package.json +39 -0
- package/node_modules/@ark/util/tsconfig.base.json +18 -0
- package/node_modules/@socket.io/component-emitter/LICENSE +24 -0
- package/node_modules/@socket.io/component-emitter/Readme.md +79 -0
- package/node_modules/@socket.io/component-emitter/lib/cjs/index.d.ts +179 -0
- package/node_modules/@socket.io/component-emitter/lib/cjs/index.js +176 -0
- package/node_modules/@socket.io/component-emitter/lib/cjs/package.json +4 -0
- package/node_modules/@socket.io/component-emitter/lib/esm/index.d.ts +179 -0
- package/node_modules/@socket.io/component-emitter/lib/esm/index.js +169 -0
- package/node_modules/@socket.io/component-emitter/lib/esm/package.json +4 -0
- package/node_modules/@socket.io/component-emitter/package.json +28 -0
- package/node_modules/arkregex/LICENSE +7 -0
- package/node_modules/arkregex/README.md +61 -0
- package/node_modules/arkregex/out/charset.d.ts +15 -0
- package/node_modules/arkregex/out/charset.js +1 -0
- package/node_modules/arkregex/out/escape.d.ts +29 -0
- package/node_modules/arkregex/out/escape.js +10 -0
- package/node_modules/arkregex/out/execArray.d.ts +23 -0
- package/node_modules/arkregex/out/execArray.js +1 -0
- package/node_modules/arkregex/out/group.d.ts +33 -0
- package/node_modules/arkregex/out/group.js +6 -0
- package/node_modules/arkregex/out/index.d.ts +1 -0
- package/node_modules/arkregex/out/index.js +1 -0
- package/node_modules/arkregex/out/parse.d.ts +10 -0
- package/node_modules/arkregex/out/parse.js +1 -0
- package/node_modules/arkregex/out/quantify.d.ts +43 -0
- package/node_modules/arkregex/out/quantify.js +2 -0
- package/node_modules/arkregex/out/regex.d.ts +38 -0
- package/node_modules/arkregex/out/regex.js +2 -0
- package/node_modules/arkregex/out/state.d.ts +359 -0
- package/node_modules/arkregex/out/state.js +2 -0
- package/node_modules/arkregex/package.json +42 -0
- package/node_modules/arktype/LICENSE +7 -0
- package/node_modules/arktype/README.md +157 -0
- package/node_modules/arktype/out/attributes.d.ts +104 -0
- package/node_modules/arktype/out/attributes.js +3 -0
- package/node_modules/arktype/out/config.d.ts +35 -0
- package/node_modules/arktype/out/config.js +3 -0
- package/node_modules/arktype/out/declare.d.ts +35 -0
- package/node_modules/arktype/out/declare.js +1 -0
- package/node_modules/arktype/out/fn.d.ts +61 -0
- package/node_modules/arktype/out/fn.js +54 -0
- package/node_modules/arktype/out/generic.d.ts +118 -0
- package/node_modules/arktype/out/generic.js +37 -0
- package/node_modules/arktype/out/index.d.ts +12 -0
- package/node_modules/arktype/out/index.js +9 -0
- package/node_modules/arktype/out/keywords/Array.d.ts +20 -0
- package/node_modules/arktype/out/keywords/Array.js +21 -0
- package/node_modules/arktype/out/keywords/FormData.d.ts +15 -0
- package/node_modules/arktype/out/keywords/FormData.js +40 -0
- package/node_modules/arktype/out/keywords/TypedArray.d.ts +19 -0
- package/node_modules/arktype/out/keywords/TypedArray.js +16 -0
- package/node_modules/arktype/out/keywords/builtins.d.ts +18 -0
- package/node_modules/arktype/out/keywords/builtins.js +11 -0
- package/node_modules/arktype/out/keywords/constructors.d.ts +31 -0
- package/node_modules/arktype/out/keywords/constructors.js +16 -0
- package/node_modules/arktype/out/keywords/keywords.d.ts +70 -0
- package/node_modules/arktype/out/keywords/keywords.js +48 -0
- package/node_modules/arktype/out/keywords/number.d.ts +23 -0
- package/node_modules/arktype/out/keywords/number.js +49 -0
- package/node_modules/arktype/out/keywords/string.d.ts +334 -0
- package/node_modules/arktype/out/keywords/string.js +463 -0
- package/node_modules/arktype/out/keywords/ts.d.ts +108 -0
- package/node_modules/arktype/out/keywords/ts.js +82 -0
- package/node_modules/arktype/out/match.d.ts +152 -0
- package/node_modules/arktype/out/match.js +95 -0
- package/node_modules/arktype/out/module.d.ts +22 -0
- package/node_modules/arktype/out/module.js +3 -0
- package/node_modules/arktype/out/nary.d.ts +473 -0
- package/node_modules/arktype/out/nary.js +1 -0
- package/node_modules/arktype/out/parser/ast/bounds.d.ts +18 -0
- package/node_modules/arktype/out/parser/ast/bounds.js +1 -0
- package/node_modules/arktype/out/parser/ast/default.d.ts +8 -0
- package/node_modules/arktype/out/parser/ast/default.js +1 -0
- package/node_modules/arktype/out/parser/ast/divisor.d.ts +9 -0
- package/node_modules/arktype/out/parser/ast/divisor.js +1 -0
- package/node_modules/arktype/out/parser/ast/generic.d.ts +17 -0
- package/node_modules/arktype/out/parser/ast/generic.js +1 -0
- package/node_modules/arktype/out/parser/ast/infer.d.ts +25 -0
- package/node_modules/arktype/out/parser/ast/infer.js +1 -0
- package/node_modules/arktype/out/parser/ast/keyof.d.ts +7 -0
- package/node_modules/arktype/out/parser/ast/keyof.js +1 -0
- package/node_modules/arktype/out/parser/ast/utils.d.ts +8 -0
- package/node_modules/arktype/out/parser/ast/utils.js +1 -0
- package/node_modules/arktype/out/parser/ast/validate.d.ts +30 -0
- package/node_modules/arktype/out/parser/ast/validate.js +3 -0
- package/node_modules/arktype/out/parser/definition.d.ts +30 -0
- package/node_modules/arktype/out/parser/definition.js +74 -0
- package/node_modules/arktype/out/parser/objectLiteral.d.ts +70 -0
- package/node_modules/arktype/out/parser/objectLiteral.js +113 -0
- package/node_modules/arktype/out/parser/property.d.ts +34 -0
- package/node_modules/arktype/out/parser/property.js +16 -0
- package/node_modules/arktype/out/parser/reduce/dynamic.d.ts +42 -0
- package/node_modules/arktype/out/parser/reduce/dynamic.js +153 -0
- package/node_modules/arktype/out/parser/reduce/shared.d.ts +39 -0
- package/node_modules/arktype/out/parser/reduce/shared.js +25 -0
- package/node_modules/arktype/out/parser/reduce/static.d.ts +186 -0
- package/node_modules/arktype/out/parser/reduce/static.js +1 -0
- package/node_modules/arktype/out/parser/shift/operand/date.d.ts +11 -0
- package/node_modules/arktype/out/parser/shift/operand/date.js +23 -0
- package/node_modules/arktype/out/parser/shift/operand/enclosed.d.ts +57 -0
- package/node_modules/arktype/out/parser/shift/operand/enclosed.js +78 -0
- package/node_modules/arktype/out/parser/shift/operand/genericArgs.d.ts +27 -0
- package/node_modules/arktype/out/parser/shift/operand/genericArgs.js +16 -0
- package/node_modules/arktype/out/parser/shift/operand/operand.d.ts +8 -0
- package/node_modules/arktype/out/parser/shift/operand/operand.js +16 -0
- package/node_modules/arktype/out/parser/shift/operand/unenclosed.d.ts +43 -0
- package/node_modules/arktype/out/parser/shift/operand/unenclosed.js +59 -0
- package/node_modules/arktype/out/parser/shift/operator/bounds.d.ts +24 -0
- package/node_modules/arktype/out/parser/shift/operator/bounds.js +91 -0
- package/node_modules/arktype/out/parser/shift/operator/brand.d.ts +7 -0
- package/node_modules/arktype/out/parser/shift/operator/brand.js +6 -0
- package/node_modules/arktype/out/parser/shift/operator/default.d.ts +24 -0
- package/node_modules/arktype/out/parser/shift/operator/default.js +15 -0
- package/node_modules/arktype/out/parser/shift/operator/divisor.d.ts +8 -0
- package/node_modules/arktype/out/parser/shift/operator/divisor.js +13 -0
- package/node_modules/arktype/out/parser/shift/operator/operator.d.ts +14 -0
- package/node_modules/arktype/out/parser/shift/operator/operator.js +28 -0
- package/node_modules/arktype/out/parser/shift/tokens.d.ts +33 -0
- package/node_modules/arktype/out/parser/shift/tokens.js +37 -0
- package/node_modules/arktype/out/parser/string.d.ts +30 -0
- package/node_modules/arktype/out/parser/string.js +42 -0
- package/node_modules/arktype/out/parser/tupleExpressions.d.ts +79 -0
- package/node_modules/arktype/out/parser/tupleExpressions.js +75 -0
- package/node_modules/arktype/out/parser/tupleLiteral.d.ts +95 -0
- package/node_modules/arktype/out/parser/tupleLiteral.js +128 -0
- package/node_modules/arktype/out/scope.d.ts +158 -0
- package/node_modules/arktype/out/scope.js +106 -0
- package/node_modules/arktype/out/type.d.ts +144 -0
- package/node_modules/arktype/out/type.js +55 -0
- package/node_modules/arktype/out/variants/array.d.ts +12 -0
- package/node_modules/arktype/out/variants/array.js +1 -0
- package/node_modules/arktype/out/variants/base.d.ts +542 -0
- package/node_modules/arktype/out/variants/base.js +1 -0
- package/node_modules/arktype/out/variants/date.d.ts +10 -0
- package/node_modules/arktype/out/variants/date.js +1 -0
- package/node_modules/arktype/out/variants/instantiate.d.ts +12 -0
- package/node_modules/arktype/out/variants/instantiate.js +1 -0
- package/node_modules/arktype/out/variants/number.d.ts +11 -0
- package/node_modules/arktype/out/variants/number.js +1 -0
- package/node_modules/arktype/out/variants/object.d.ts +107 -0
- package/node_modules/arktype/out/variants/object.js +1 -0
- package/node_modules/arktype/out/variants/string.d.ts +15 -0
- package/node_modules/arktype/out/variants/string.js +1 -0
- package/node_modules/arktype/package.json +57 -0
- package/node_modules/debug/LICENSE +20 -0
- package/node_modules/debug/README.md +481 -0
- package/node_modules/debug/package.json +64 -0
- package/node_modules/debug/src/browser.js +272 -0
- package/node_modules/debug/src/common.js +292 -0
- package/node_modules/debug/src/index.js +10 -0
- package/node_modules/debug/src/node.js +263 -0
- package/node_modules/engine.io-client/LICENSE +22 -0
- package/node_modules/engine.io-client/README.md +331 -0
- package/node_modules/engine.io-client/build/cjs/browser-entrypoint.d.ts +3 -0
- package/node_modules/engine.io-client/build/cjs/browser-entrypoint.js +4 -0
- package/node_modules/engine.io-client/build/cjs/contrib/has-cors.d.ts +1 -0
- package/node_modules/engine.io-client/build/cjs/contrib/has-cors.js +14 -0
- package/node_modules/engine.io-client/build/cjs/contrib/parseqs.d.ts +15 -0
- package/node_modules/engine.io-client/build/cjs/contrib/parseqs.js +38 -0
- package/node_modules/engine.io-client/build/cjs/contrib/parseuri.d.ts +1 -0
- package/node_modules/engine.io-client/build/cjs/contrib/parseuri.js +67 -0
- package/node_modules/engine.io-client/build/cjs/globals.d.ts +4 -0
- package/node_modules/engine.io-client/build/cjs/globals.js +26 -0
- package/node_modules/engine.io-client/build/cjs/globals.node.d.ts +21 -0
- package/node_modules/engine.io-client/build/cjs/globals.node.js +97 -0
- package/node_modules/engine.io-client/build/cjs/index.d.ts +15 -0
- package/node_modules/engine.io-client/build/cjs/index.js +32 -0
- package/node_modules/engine.io-client/build/cjs/package.json +10 -0
- package/node_modules/engine.io-client/build/cjs/socket.d.ts +482 -0
- package/node_modules/engine.io-client/build/cjs/socket.js +765 -0
- package/node_modules/engine.io-client/build/cjs/transport.d.ts +106 -0
- package/node_modules/engine.io-client/build/cjs/transport.js +153 -0
- package/node_modules/engine.io-client/build/cjs/transports/index.d.ts +8 -0
- package/node_modules/engine.io-client/build/cjs/transports/index.js +11 -0
- package/node_modules/engine.io-client/build/cjs/transports/polling-fetch.d.ts +15 -0
- package/node_modules/engine.io-client/build/cjs/transports/polling-fetch.js +60 -0
- package/node_modules/engine.io-client/build/cjs/transports/polling-xhr.d.ts +108 -0
- package/node_modules/engine.io-client/build/cjs/transports/polling-xhr.js +285 -0
- package/node_modules/engine.io-client/build/cjs/transports/polling-xhr.node.d.ts +11 -0
- package/node_modules/engine.io-client/build/cjs/transports/polling-xhr.node.js +44 -0
- package/node_modules/engine.io-client/build/cjs/transports/polling.d.ts +52 -0
- package/node_modules/engine.io-client/build/cjs/transports/polling.js +165 -0
- package/node_modules/engine.io-client/build/cjs/transports/websocket.d.ts +36 -0
- package/node_modules/engine.io-client/build/cjs/transports/websocket.js +136 -0
- package/node_modules/engine.io-client/build/cjs/transports/websocket.node.d.ts +14 -0
- package/node_modules/engine.io-client/build/cjs/transports/websocket.node.js +68 -0
- package/node_modules/engine.io-client/build/cjs/transports/webtransport.d.ts +18 -0
- package/node_modules/engine.io-client/build/cjs/transports/webtransport.js +94 -0
- package/node_modules/engine.io-client/build/cjs/util.d.ts +7 -0
- package/node_modules/engine.io-client/build/cjs/util.js +65 -0
- package/node_modules/engine.io-client/build/esm/browser-entrypoint.d.ts +3 -0
- package/node_modules/engine.io-client/build/esm/browser-entrypoint.js +2 -0
- package/node_modules/engine.io-client/build/esm/contrib/has-cors.d.ts +1 -0
- package/node_modules/engine.io-client/build/esm/contrib/has-cors.js +11 -0
- package/node_modules/engine.io-client/build/esm/contrib/parseqs.d.ts +15 -0
- package/node_modules/engine.io-client/build/esm/contrib/parseqs.js +34 -0
- package/node_modules/engine.io-client/build/esm/contrib/parseuri.d.ts +1 -0
- package/node_modules/engine.io-client/build/esm/contrib/parseuri.js +64 -0
- package/node_modules/engine.io-client/build/esm/globals.d.ts +4 -0
- package/node_modules/engine.io-client/build/esm/globals.js +22 -0
- package/node_modules/engine.io-client/build/esm/globals.node.d.ts +21 -0
- package/node_modules/engine.io-client/build/esm/globals.node.js +91 -0
- package/node_modules/engine.io-client/build/esm/index.d.ts +15 -0
- package/node_modules/engine.io-client/build/esm/index.js +15 -0
- package/node_modules/engine.io-client/build/esm/package.json +10 -0
- package/node_modules/engine.io-client/build/esm/socket.d.ts +482 -0
- package/node_modules/engine.io-client/build/esm/socket.js +727 -0
- package/node_modules/engine.io-client/build/esm/transport.d.ts +106 -0
- package/node_modules/engine.io-client/build/esm/transport.js +142 -0
- package/node_modules/engine.io-client/build/esm/transports/index.d.ts +8 -0
- package/node_modules/engine.io-client/build/esm/transports/index.js +8 -0
- package/node_modules/engine.io-client/build/esm/transports/polling-fetch.d.ts +15 -0
- package/node_modules/engine.io-client/build/esm/transports/polling-fetch.js +56 -0
- package/node_modules/engine.io-client/build/esm/transports/polling-xhr.d.ts +108 -0
- package/node_modules/engine.io-client/build/esm/transports/polling-xhr.js +271 -0
- package/node_modules/engine.io-client/build/esm/transports/polling-xhr.node.d.ts +11 -0
- package/node_modules/engine.io-client/build/esm/transports/polling-xhr.node.js +17 -0
- package/node_modules/engine.io-client/build/esm/transports/polling.d.ts +52 -0
- package/node_modules/engine.io-client/build/esm/transports/polling.js +145 -0
- package/node_modules/engine.io-client/build/esm/transports/websocket.d.ts +36 -0
- package/node_modules/engine.io-client/build/esm/transports/websocket.js +125 -0
- package/node_modules/engine.io-client/build/esm/transports/websocket.node.d.ts +14 -0
- package/node_modules/engine.io-client/build/esm/transports/websocket.node.js +41 -0
- package/node_modules/engine.io-client/build/esm/transports/webtransport.d.ts +18 -0
- package/node_modules/engine.io-client/build/esm/transports/webtransport.js +80 -0
- package/node_modules/engine.io-client/build/esm/util.d.ts +7 -0
- package/node_modules/engine.io-client/build/esm/util.js +59 -0
- package/node_modules/engine.io-client/build/esm-debug/browser-entrypoint.d.ts +3 -0
- package/node_modules/engine.io-client/build/esm-debug/browser-entrypoint.js +2 -0
- package/node_modules/engine.io-client/build/esm-debug/contrib/has-cors.d.ts +1 -0
- package/node_modules/engine.io-client/build/esm-debug/contrib/has-cors.js +11 -0
- package/node_modules/engine.io-client/build/esm-debug/contrib/parseqs.d.ts +15 -0
- package/node_modules/engine.io-client/build/esm-debug/contrib/parseqs.js +34 -0
- package/node_modules/engine.io-client/build/esm-debug/contrib/parseuri.d.ts +1 -0
- package/node_modules/engine.io-client/build/esm-debug/contrib/parseuri.js +64 -0
- package/node_modules/engine.io-client/build/esm-debug/globals.d.ts +4 -0
- package/node_modules/engine.io-client/build/esm-debug/globals.js +22 -0
- package/node_modules/engine.io-client/build/esm-debug/globals.node.d.ts +21 -0
- package/node_modules/engine.io-client/build/esm-debug/globals.node.js +91 -0
- package/node_modules/engine.io-client/build/esm-debug/index.d.ts +15 -0
- package/node_modules/engine.io-client/build/esm-debug/index.js +15 -0
- package/node_modules/engine.io-client/build/esm-debug/package.json +10 -0
- package/node_modules/engine.io-client/build/esm-debug/socket.d.ts +482 -0
- package/node_modules/engine.io-client/build/esm-debug/socket.js +756 -0
- package/node_modules/engine.io-client/build/esm-debug/transport.d.ts +106 -0
- package/node_modules/engine.io-client/build/esm-debug/transport.js +145 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/index.d.ts +8 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/index.js +8 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/polling-fetch.d.ts +15 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/polling-fetch.js +56 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/polling-xhr.d.ts +108 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/polling-xhr.js +276 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/polling-xhr.node.d.ts +11 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/polling-xhr.node.js +17 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/polling.d.ts +52 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/polling.js +158 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/websocket.d.ts +36 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/websocket.js +128 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/websocket.node.d.ts +14 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/websocket.node.js +41 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/webtransport.d.ts +18 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/webtransport.js +87 -0
- package/node_modules/engine.io-client/build/esm-debug/util.d.ts +7 -0
- package/node_modules/engine.io-client/build/esm-debug/util.js +59 -0
- package/node_modules/engine.io-client/dist/engine.io.esm.min.js +7 -0
- package/node_modules/engine.io-client/dist/engine.io.esm.min.js.map +1 -0
- package/node_modules/engine.io-client/dist/engine.io.js +3064 -0
- package/node_modules/engine.io-client/dist/engine.io.js.map +1 -0
- package/node_modules/engine.io-client/dist/engine.io.min.js +7 -0
- package/node_modules/engine.io-client/dist/engine.io.min.js.map +1 -0
- package/node_modules/engine.io-client/package.json +95 -0
- package/node_modules/engine.io-parser/LICENSE +22 -0
- package/node_modules/engine.io-parser/Readme.md +158 -0
- package/node_modules/engine.io-parser/build/cjs/commons.d.ts +14 -0
- package/node_modules/engine.io-parser/build/cjs/commons.js +19 -0
- package/node_modules/engine.io-parser/build/cjs/contrib/base64-arraybuffer.d.ts +2 -0
- package/node_modules/engine.io-parser/build/cjs/contrib/base64-arraybuffer.js +48 -0
- package/node_modules/engine.io-parser/build/cjs/decodePacket.browser.d.ts +2 -0
- package/node_modules/engine.io-parser/build/cjs/decodePacket.browser.js +66 -0
- package/node_modules/engine.io-parser/build/cjs/decodePacket.d.ts +2 -0
- package/node_modules/engine.io-parser/build/cjs/decodePacket.js +59 -0
- package/node_modules/engine.io-parser/build/cjs/encodePacket.browser.d.ts +4 -0
- package/node_modules/engine.io-parser/build/cjs/encodePacket.browser.js +72 -0
- package/node_modules/engine.io-parser/build/cjs/encodePacket.d.ts +3 -0
- package/node_modules/engine.io-parser/build/cjs/encodePacket.js +38 -0
- package/node_modules/engine.io-parser/build/cjs/index.d.ts +9 -0
- package/node_modules/engine.io-parser/build/cjs/index.js +164 -0
- package/node_modules/engine.io-parser/build/cjs/package.json +8 -0
- package/node_modules/engine.io-parser/build/esm/commons.d.ts +14 -0
- package/node_modules/engine.io-parser/build/esm/commons.js +14 -0
- package/node_modules/engine.io-parser/build/esm/contrib/base64-arraybuffer.d.ts +2 -0
- package/node_modules/engine.io-parser/build/esm/contrib/base64-arraybuffer.js +43 -0
- package/node_modules/engine.io-parser/build/esm/decodePacket.browser.d.ts +2 -0
- package/node_modules/engine.io-parser/build/esm/decodePacket.browser.js +62 -0
- package/node_modules/engine.io-parser/build/esm/decodePacket.d.ts +2 -0
- package/node_modules/engine.io-parser/build/esm/decodePacket.js +55 -0
- package/node_modules/engine.io-parser/build/esm/encodePacket.browser.d.ts +4 -0
- package/node_modules/engine.io-parser/build/esm/encodePacket.browser.js +68 -0
- package/node_modules/engine.io-parser/build/esm/encodePacket.d.ts +3 -0
- package/node_modules/engine.io-parser/build/esm/encodePacket.js +33 -0
- package/node_modules/engine.io-parser/build/esm/index.d.ts +9 -0
- package/node_modules/engine.io-parser/build/esm/index.js +156 -0
- package/node_modules/engine.io-parser/build/esm/package.json +8 -0
- package/node_modules/engine.io-parser/package.json +46 -0
- package/node_modules/ms/index.js +162 -0
- package/node_modules/ms/license.md +21 -0
- package/node_modules/ms/package.json +38 -0
- package/node_modules/ms/readme.md +59 -0
- package/node_modules/socket.io-client/LICENSE +21 -0
- package/node_modules/socket.io-client/README.md +29 -0
- package/node_modules/socket.io-client/build/cjs/browser-entrypoint.d.ts +2 -0
- package/node_modules/socket.io-client/build/cjs/browser-entrypoint.js +4 -0
- package/node_modules/socket.io-client/build/cjs/contrib/backo2.d.ts +12 -0
- package/node_modules/socket.io-client/build/cjs/contrib/backo2.js +69 -0
- package/node_modules/socket.io-client/build/cjs/index.d.ts +29 -0
- package/node_modules/socket.io-client/build/cjs/index.js +76 -0
- package/node_modules/socket.io-client/build/cjs/manager.d.ts +295 -0
- package/node_modules/socket.io-client/build/cjs/manager.js +416 -0
- package/node_modules/socket.io-client/build/cjs/on.d.ts +2 -0
- package/node_modules/socket.io-client/build/cjs/on.js +9 -0
- package/node_modules/socket.io-client/build/cjs/socket.d.ts +593 -0
- package/node_modules/socket.io-client/build/cjs/socket.js +909 -0
- package/node_modules/socket.io-client/build/cjs/url.d.ts +33 -0
- package/node_modules/socket.io-client/build/cjs/url.js +69 -0
- package/node_modules/socket.io-client/build/esm/browser-entrypoint.d.ts +2 -0
- package/node_modules/socket.io-client/build/esm/browser-entrypoint.js +2 -0
- package/node_modules/socket.io-client/build/esm/contrib/backo2.d.ts +12 -0
- package/node_modules/socket.io-client/build/esm/contrib/backo2.js +66 -0
- package/node_modules/socket.io-client/build/esm/index.d.ts +29 -0
- package/node_modules/socket.io-client/build/esm/index.js +58 -0
- package/node_modules/socket.io-client/build/esm/manager.d.ts +295 -0
- package/node_modules/socket.io-client/build/esm/manager.js +367 -0
- package/node_modules/socket.io-client/build/esm/on.d.ts +2 -0
- package/node_modules/socket.io-client/build/esm/on.js +6 -0
- package/node_modules/socket.io-client/build/esm/package.json +5 -0
- package/node_modules/socket.io-client/build/esm/socket.d.ts +593 -0
- package/node_modules/socket.io-client/build/esm/socket.js +880 -0
- package/node_modules/socket.io-client/build/esm/url.d.ts +33 -0
- package/node_modules/socket.io-client/build/esm/url.js +59 -0
- package/node_modules/socket.io-client/build/esm-debug/browser-entrypoint.d.ts +2 -0
- package/node_modules/socket.io-client/build/esm-debug/browser-entrypoint.js +2 -0
- package/node_modules/socket.io-client/build/esm-debug/contrib/backo2.d.ts +12 -0
- package/node_modules/socket.io-client/build/esm-debug/contrib/backo2.js +66 -0
- package/node_modules/socket.io-client/build/esm-debug/index.d.ts +29 -0
- package/node_modules/socket.io-client/build/esm-debug/index.js +62 -0
- package/node_modules/socket.io-client/build/esm-debug/manager.d.ts +295 -0
- package/node_modules/socket.io-client/build/esm-debug/manager.js +386 -0
- package/node_modules/socket.io-client/build/esm-debug/on.d.ts +2 -0
- package/node_modules/socket.io-client/build/esm-debug/on.js +6 -0
- package/node_modules/socket.io-client/build/esm-debug/package.json +5 -0
- package/node_modules/socket.io-client/build/esm-debug/socket.d.ts +593 -0
- package/node_modules/socket.io-client/build/esm-debug/socket.js +902 -0
- package/node_modules/socket.io-client/build/esm-debug/url.d.ts +33 -0
- package/node_modules/socket.io-client/build/esm-debug/url.js +63 -0
- package/node_modules/socket.io-client/dist/socket.io.esm.min.js +7 -0
- package/node_modules/socket.io-client/dist/socket.io.esm.min.js.map +1 -0
- package/node_modules/socket.io-client/dist/socket.io.js +4955 -0
- package/node_modules/socket.io-client/dist/socket.io.js.map +1 -0
- package/node_modules/socket.io-client/dist/socket.io.min.js +7 -0
- package/node_modules/socket.io-client/dist/socket.io.min.js.map +1 -0
- package/node_modules/socket.io-client/dist/socket.io.msgpack.min.js +7 -0
- package/node_modules/socket.io-client/dist/socket.io.msgpack.min.js.map +1 -0
- package/node_modules/socket.io-client/package.json +101 -0
- package/node_modules/socket.io-parser/LICENSE +20 -0
- package/node_modules/socket.io-parser/Readme.md +81 -0
- package/node_modules/socket.io-parser/build/cjs/binary.d.ts +20 -0
- package/node_modules/socket.io-parser/build/cjs/binary.js +87 -0
- package/node_modules/socket.io-parser/build/cjs/index.d.ts +91 -0
- package/node_modules/socket.io-parser/build/cjs/index.js +359 -0
- package/node_modules/socket.io-parser/build/cjs/is-binary.d.ts +7 -0
- package/node_modules/socket.io-parser/build/cjs/is-binary.js +54 -0
- package/node_modules/socket.io-parser/build/cjs/package.json +3 -0
- package/node_modules/socket.io-parser/build/esm/binary.d.ts +20 -0
- package/node_modules/socket.io-parser/build/esm/binary.js +83 -0
- package/node_modules/socket.io-parser/build/esm/index.d.ts +91 -0
- package/node_modules/socket.io-parser/build/esm/index.js +348 -0
- package/node_modules/socket.io-parser/build/esm/is-binary.d.ts +7 -0
- package/node_modules/socket.io-parser/build/esm/is-binary.js +50 -0
- package/node_modules/socket.io-parser/build/esm/package.json +3 -0
- package/node_modules/socket.io-parser/build/esm-debug/binary.d.ts +20 -0
- package/node_modules/socket.io-parser/build/esm-debug/binary.js +83 -0
- package/node_modules/socket.io-parser/build/esm-debug/index.d.ts +91 -0
- package/node_modules/socket.io-parser/build/esm-debug/index.js +353 -0
- package/node_modules/socket.io-parser/build/esm-debug/is-binary.d.ts +7 -0
- package/node_modules/socket.io-parser/build/esm-debug/is-binary.js +50 -0
- package/node_modules/socket.io-parser/build/esm-debug/package.json +3 -0
- package/node_modules/socket.io-parser/package.json +44 -0
- package/node_modules/ws/LICENSE +20 -0
- package/node_modules/ws/README.md +548 -0
- package/node_modules/ws/browser.js +8 -0
- package/node_modules/ws/index.js +13 -0
- package/node_modules/ws/lib/buffer-util.js +131 -0
- package/node_modules/ws/lib/constants.js +18 -0
- package/node_modules/ws/lib/event-target.js +292 -0
- package/node_modules/ws/lib/extension.js +203 -0
- package/node_modules/ws/lib/limiter.js +55 -0
- package/node_modules/ws/lib/permessage-deflate.js +528 -0
- package/node_modules/ws/lib/receiver.js +706 -0
- package/node_modules/ws/lib/sender.js +602 -0
- package/node_modules/ws/lib/stream.js +161 -0
- package/node_modules/ws/lib/subprotocol.js +62 -0
- package/node_modules/ws/lib/validation.js +152 -0
- package/node_modules/ws/lib/websocket-server.js +550 -0
- package/node_modules/ws/lib/websocket.js +1388 -0
- package/node_modules/ws/package.json +69 -0
- package/node_modules/ws/wrapper.mjs +8 -0
- package/node_modules/xmlhttprequest-ssl/LICENSE +22 -0
- package/node_modules/xmlhttprequest-ssl/README.md +67 -0
- package/node_modules/xmlhttprequest-ssl/lib/XMLHttpRequest.js +689 -0
- package/node_modules/xmlhttprequest-ssl/package.json +40 -0
- package/package.json +34 -4
- package/public-api.md +85 -23
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import type { DescribeOptions } from "./describe.ts";
|
|
2
|
+
import { type domainDescriptions, domainOf } from "./domain.ts";
|
|
3
|
+
import type { Fn } from "./functions.ts";
|
|
4
|
+
import type { satisfy } from "./generics.ts";
|
|
5
|
+
export declare const ecmascriptConstructors: {
|
|
6
|
+
Array: ArrayConstructor;
|
|
7
|
+
Boolean: BooleanConstructor;
|
|
8
|
+
Date: DateConstructor;
|
|
9
|
+
Error: ErrorConstructor;
|
|
10
|
+
Function: FunctionConstructor;
|
|
11
|
+
Map: MapConstructor;
|
|
12
|
+
Number: NumberConstructor;
|
|
13
|
+
Promise: PromiseConstructor;
|
|
14
|
+
RegExp: RegExpConstructor;
|
|
15
|
+
Set: SetConstructor;
|
|
16
|
+
String: StringConstructor;
|
|
17
|
+
WeakMap: WeakMapConstructor;
|
|
18
|
+
WeakSet: WeakSetConstructor;
|
|
19
|
+
};
|
|
20
|
+
export type ecmascriptConstructors = typeof ecmascriptConstructors;
|
|
21
|
+
export type EcmascriptObjects = satisfy<instantiateConstructors<keyof ecmascriptConstructors>, {
|
|
22
|
+
Array: Array<unknown>;
|
|
23
|
+
Boolean: Boolean;
|
|
24
|
+
Date: Date;
|
|
25
|
+
Error: Error;
|
|
26
|
+
Function: Function;
|
|
27
|
+
Map: Map<unknown, unknown>;
|
|
28
|
+
Number: Number;
|
|
29
|
+
RegExp: RegExp;
|
|
30
|
+
Set: Set<unknown>;
|
|
31
|
+
String: String;
|
|
32
|
+
WeakMap: WeakMap<object, unknown>;
|
|
33
|
+
WeakSet: WeakSet<object>;
|
|
34
|
+
Promise: Promise<unknown>;
|
|
35
|
+
}>;
|
|
36
|
+
/** Node18 */
|
|
37
|
+
export declare const FileConstructor: typeof import("buffer").File;
|
|
38
|
+
export type platformConstructors = {
|
|
39
|
+
ArrayBuffer: ArrayBufferConstructor;
|
|
40
|
+
Blob: typeof Blob;
|
|
41
|
+
File: typeof File;
|
|
42
|
+
FormData: typeof FormData;
|
|
43
|
+
Headers: typeof Headers;
|
|
44
|
+
Request: typeof Request;
|
|
45
|
+
Response: typeof Response;
|
|
46
|
+
URL: typeof URL;
|
|
47
|
+
};
|
|
48
|
+
export declare const platformConstructors: platformConstructors;
|
|
49
|
+
export type PlatformObjects = instantiateConstructors<keyof platformConstructors>;
|
|
50
|
+
export declare const typedArrayConstructors: {
|
|
51
|
+
Int8Array: Int8ArrayConstructor;
|
|
52
|
+
Uint8Array: Uint8ArrayConstructor;
|
|
53
|
+
Uint8ClampedArray: Uint8ClampedArrayConstructor;
|
|
54
|
+
Int16Array: Int16ArrayConstructor;
|
|
55
|
+
Uint16Array: Uint16ArrayConstructor;
|
|
56
|
+
Int32Array: Int32ArrayConstructor;
|
|
57
|
+
Uint32Array: Uint32ArrayConstructor;
|
|
58
|
+
Float32Array: Float32ArrayConstructor;
|
|
59
|
+
Float64Array: Float64ArrayConstructor;
|
|
60
|
+
BigInt64Array: BigInt64ArrayConstructor;
|
|
61
|
+
BigUint64Array: BigUint64ArrayConstructor;
|
|
62
|
+
};
|
|
63
|
+
export type typedArrayConstructors = typeof typedArrayConstructors;
|
|
64
|
+
export type TypedArrayObjects = instantiateConstructors<keyof typedArrayConstructors>;
|
|
65
|
+
export declare const builtinConstructors: {
|
|
66
|
+
String: StringConstructor;
|
|
67
|
+
Number: NumberConstructor;
|
|
68
|
+
Boolean: BooleanConstructor;
|
|
69
|
+
Int8Array: Int8ArrayConstructor;
|
|
70
|
+
Uint8Array: Uint8ArrayConstructor;
|
|
71
|
+
Uint8ClampedArray: Uint8ClampedArrayConstructor;
|
|
72
|
+
Int16Array: Int16ArrayConstructor;
|
|
73
|
+
Uint16Array: Uint16ArrayConstructor;
|
|
74
|
+
Int32Array: Int32ArrayConstructor;
|
|
75
|
+
Uint32Array: Uint32ArrayConstructor;
|
|
76
|
+
Float32Array: Float32ArrayConstructor;
|
|
77
|
+
Float64Array: Float64ArrayConstructor;
|
|
78
|
+
BigInt64Array: BigInt64ArrayConstructor;
|
|
79
|
+
BigUint64Array: BigUint64ArrayConstructor;
|
|
80
|
+
ArrayBuffer: ArrayBufferConstructor;
|
|
81
|
+
Blob: typeof Blob;
|
|
82
|
+
File: typeof File;
|
|
83
|
+
FormData: typeof FormData;
|
|
84
|
+
Headers: typeof Headers;
|
|
85
|
+
Request: typeof Request;
|
|
86
|
+
Response: typeof Response;
|
|
87
|
+
URL: typeof URL;
|
|
88
|
+
Array: ArrayConstructor;
|
|
89
|
+
Date: DateConstructor;
|
|
90
|
+
Error: ErrorConstructor;
|
|
91
|
+
Function: FunctionConstructor;
|
|
92
|
+
Map: MapConstructor;
|
|
93
|
+
Promise: PromiseConstructor;
|
|
94
|
+
RegExp: RegExpConstructor;
|
|
95
|
+
Set: SetConstructor;
|
|
96
|
+
WeakMap: WeakMapConstructor;
|
|
97
|
+
WeakSet: WeakSetConstructor;
|
|
98
|
+
};
|
|
99
|
+
export type builtinConstructors = typeof builtinConstructors;
|
|
100
|
+
export type BuiltinObjectKind = keyof builtinConstructors;
|
|
101
|
+
export type GlobalName = keyof typeof globalThis;
|
|
102
|
+
type instantiateConstructors<kind extends BuiltinObjectKind> = {
|
|
103
|
+
[k in kind]: k extends GlobalName ? InstanceType<(typeof globalThis)[k]> : `${k}Constructor` extends GlobalName ? InstanceType<(typeof globalThis)[`${k}Constructor`]> : never;
|
|
104
|
+
};
|
|
105
|
+
export type BuiltinObjects = instantiateConstructors<BuiltinObjectKind>;
|
|
106
|
+
export type objectKindOf<data extends object> = object extends data ? keyof builtinConstructors | undefined : data extends Fn ? "Function" : instantiableObjectKind<data> extends never ? undefined : instantiableObjectKind<data>;
|
|
107
|
+
export type describeObject<o extends object, opts extends DescribeOptions = {}> = objectKindOf<o> extends string ? [
|
|
108
|
+
opts["includeArticles"]
|
|
109
|
+
] extends [true] ? objectKindDescriptions[objectKindOf<o>] : objectKindOf<o> : [opts["includeArticles"]] extends [true] ? domainDescriptions["object"] : "object";
|
|
110
|
+
type instantiableObjectKind<data extends object> = {
|
|
111
|
+
[kind in keyof builtinConstructors]: data extends (InstanceType<builtinConstructors[kind]>) ? kind : never;
|
|
112
|
+
}[keyof builtinConstructors];
|
|
113
|
+
export declare const objectKindOf: <data extends object>(data: data) => objectKindOf<data> | undefined;
|
|
114
|
+
export declare const objectKindOrDomainOf: <data>(data: data) => (objectKindOf<data & object> & {}) | domainOf<data>;
|
|
115
|
+
export type objectKindOrDomainOf<data> = data extends object ? objectKindOf<data> extends undefined ? "object" : objectKindOf<data> : domainOf<data>;
|
|
116
|
+
export declare const hasObjectKind: <kind extends keyof builtinConstructors>(data: object, kind: kind) => data is InstanceType<builtinConstructors[kind]>;
|
|
117
|
+
export declare const isArray: (data: unknown) => data is readonly unknown[];
|
|
118
|
+
export declare const ecmascriptDescriptions: {
|
|
119
|
+
readonly Array: "an array";
|
|
120
|
+
readonly Function: "a function";
|
|
121
|
+
readonly Date: "a Date";
|
|
122
|
+
readonly RegExp: "a RegExp";
|
|
123
|
+
readonly Error: "an Error";
|
|
124
|
+
readonly Map: "a Map";
|
|
125
|
+
readonly Set: "a Set";
|
|
126
|
+
readonly String: "a String object";
|
|
127
|
+
readonly Number: "a Number object";
|
|
128
|
+
readonly Boolean: "a Boolean object";
|
|
129
|
+
readonly Promise: "a Promise";
|
|
130
|
+
readonly WeakMap: "a WeakMap";
|
|
131
|
+
readonly WeakSet: "a WeakSet";
|
|
132
|
+
};
|
|
133
|
+
export declare const platformDescriptions: {
|
|
134
|
+
ArrayBuffer: string;
|
|
135
|
+
Blob: string;
|
|
136
|
+
File: string;
|
|
137
|
+
FormData: string;
|
|
138
|
+
Headers: string;
|
|
139
|
+
Request: string;
|
|
140
|
+
Response: string;
|
|
141
|
+
URL: string;
|
|
142
|
+
};
|
|
143
|
+
export declare const typedArrayDescriptions: {
|
|
144
|
+
readonly Int8Array: "an Int8Array";
|
|
145
|
+
readonly Uint8Array: "a Uint8Array";
|
|
146
|
+
readonly Uint8ClampedArray: "a Uint8ClampedArray";
|
|
147
|
+
readonly Int16Array: "an Int16Array";
|
|
148
|
+
readonly Uint16Array: "a Uint16Array";
|
|
149
|
+
readonly Int32Array: "an Int32Array";
|
|
150
|
+
readonly Uint32Array: "a Uint32Array";
|
|
151
|
+
readonly Float32Array: "a Float32Array";
|
|
152
|
+
readonly Float64Array: "a Float64Array";
|
|
153
|
+
readonly BigInt64Array: "a BigInt64Array";
|
|
154
|
+
readonly BigUint64Array: "a BigUint64Array";
|
|
155
|
+
};
|
|
156
|
+
/** Each defaultObjectKind's completion for the phrase "must be _____" */
|
|
157
|
+
export declare const objectKindDescriptions: {
|
|
158
|
+
readonly Int8Array: "an Int8Array";
|
|
159
|
+
readonly Uint8Array: "a Uint8Array";
|
|
160
|
+
readonly Uint8ClampedArray: "a Uint8ClampedArray";
|
|
161
|
+
readonly Int16Array: "an Int16Array";
|
|
162
|
+
readonly Uint16Array: "a Uint16Array";
|
|
163
|
+
readonly Int32Array: "an Int32Array";
|
|
164
|
+
readonly Uint32Array: "a Uint32Array";
|
|
165
|
+
readonly Float32Array: "a Float32Array";
|
|
166
|
+
readonly Float64Array: "a Float64Array";
|
|
167
|
+
readonly BigInt64Array: "a BigInt64Array";
|
|
168
|
+
readonly BigUint64Array: "a BigUint64Array";
|
|
169
|
+
readonly ArrayBuffer: string;
|
|
170
|
+
readonly Blob: string;
|
|
171
|
+
readonly File: string;
|
|
172
|
+
readonly FormData: string;
|
|
173
|
+
readonly Headers: string;
|
|
174
|
+
readonly Request: string;
|
|
175
|
+
readonly Response: string;
|
|
176
|
+
readonly URL: string;
|
|
177
|
+
readonly Array: "an array";
|
|
178
|
+
readonly Function: "a function";
|
|
179
|
+
readonly Date: "a Date";
|
|
180
|
+
readonly RegExp: "a RegExp";
|
|
181
|
+
readonly Error: "an Error";
|
|
182
|
+
readonly Map: "a Map";
|
|
183
|
+
readonly Set: "a Set";
|
|
184
|
+
readonly String: "a String object";
|
|
185
|
+
readonly Number: "a Number object";
|
|
186
|
+
readonly Boolean: "a Boolean object";
|
|
187
|
+
readonly Promise: "a Promise";
|
|
188
|
+
readonly WeakMap: "a WeakMap";
|
|
189
|
+
readonly WeakSet: "a WeakSet";
|
|
190
|
+
};
|
|
191
|
+
export type objectKindDescriptions = typeof objectKindDescriptions;
|
|
192
|
+
/**
|
|
193
|
+
* this will only return an object kind if it's the root constructor
|
|
194
|
+
* example TypeError would return null not 'Error'
|
|
195
|
+
**/
|
|
196
|
+
export declare const getBuiltinNameOfConstructor: (ctor: Function) => BuiltinObjectKind | null;
|
|
197
|
+
export type Constructor<instance = {}> = abstract new (...args: never[]) => instance;
|
|
198
|
+
export type instanceOf<constructor> = constructor extends Constructor<infer instance> ? instance : never;
|
|
199
|
+
/**
|
|
200
|
+
* Returns an array of constructors for all ancestors (i.e., prototypes) of a given object.
|
|
201
|
+
*/
|
|
202
|
+
export declare const ancestorsOf: (o: object) => Function[];
|
|
203
|
+
export type normalizedKeyOf<t> = keyof t extends infer k ? k extends number ? `${k}` : k : never;
|
|
204
|
+
export declare const constructorExtends: (ctor: Constructor, base: Constructor) => boolean;
|
|
205
|
+
export {};
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { domainOf } from "./domain.js";
|
|
2
|
+
import { isKeyOf } from "./records.js";
|
|
3
|
+
// ECMAScript Objects
|
|
4
|
+
// See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects
|
|
5
|
+
export const ecmascriptConstructors = {
|
|
6
|
+
Array,
|
|
7
|
+
Boolean,
|
|
8
|
+
Date,
|
|
9
|
+
Error,
|
|
10
|
+
Function,
|
|
11
|
+
Map,
|
|
12
|
+
Number,
|
|
13
|
+
Promise,
|
|
14
|
+
RegExp,
|
|
15
|
+
Set,
|
|
16
|
+
String,
|
|
17
|
+
WeakMap,
|
|
18
|
+
WeakSet
|
|
19
|
+
};
|
|
20
|
+
/** Node18 */
|
|
21
|
+
export const FileConstructor = globalThis.File ?? Blob;
|
|
22
|
+
// Platform APIs
|
|
23
|
+
// See https://developer.mozilla.org/en-US/docs/Web/API
|
|
24
|
+
// Must be implemented in Node etc. as well as the browser to include here
|
|
25
|
+
export const platformConstructors = {
|
|
26
|
+
ArrayBuffer,
|
|
27
|
+
Blob,
|
|
28
|
+
File: FileConstructor,
|
|
29
|
+
FormData,
|
|
30
|
+
Headers,
|
|
31
|
+
Request,
|
|
32
|
+
Response,
|
|
33
|
+
URL
|
|
34
|
+
};
|
|
35
|
+
export const typedArrayConstructors = {
|
|
36
|
+
Int8Array,
|
|
37
|
+
Uint8Array,
|
|
38
|
+
Uint8ClampedArray,
|
|
39
|
+
Int16Array,
|
|
40
|
+
Uint16Array,
|
|
41
|
+
Int32Array,
|
|
42
|
+
Uint32Array,
|
|
43
|
+
Float32Array,
|
|
44
|
+
Float64Array,
|
|
45
|
+
BigInt64Array,
|
|
46
|
+
BigUint64Array
|
|
47
|
+
};
|
|
48
|
+
// Built-in object constructors based on a subset of:
|
|
49
|
+
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects
|
|
50
|
+
export const builtinConstructors = {
|
|
51
|
+
...ecmascriptConstructors,
|
|
52
|
+
...platformConstructors,
|
|
53
|
+
...typedArrayConstructors,
|
|
54
|
+
String,
|
|
55
|
+
Number,
|
|
56
|
+
Boolean
|
|
57
|
+
};
|
|
58
|
+
export const objectKindOf = (data) => {
|
|
59
|
+
let prototype = Object.getPrototypeOf(data);
|
|
60
|
+
while (prototype?.constructor &&
|
|
61
|
+
(!isKeyOf(prototype.constructor.name, builtinConstructors) ||
|
|
62
|
+
!(data instanceof builtinConstructors[prototype.constructor.name])))
|
|
63
|
+
prototype = Object.getPrototypeOf(prototype);
|
|
64
|
+
const name = prototype?.constructor?.name;
|
|
65
|
+
if (name === undefined || name === "Object")
|
|
66
|
+
return undefined;
|
|
67
|
+
return name;
|
|
68
|
+
};
|
|
69
|
+
export const objectKindOrDomainOf = (data) => (typeof data === "object" && data !== null ?
|
|
70
|
+
(objectKindOf(data) ?? "object")
|
|
71
|
+
: domainOf(data));
|
|
72
|
+
export const hasObjectKind = (data, kind) => objectKindOf(data) === kind;
|
|
73
|
+
export const isArray = Array.isArray;
|
|
74
|
+
export const ecmascriptDescriptions = {
|
|
75
|
+
Array: "an array",
|
|
76
|
+
Function: "a function",
|
|
77
|
+
Date: "a Date",
|
|
78
|
+
RegExp: "a RegExp",
|
|
79
|
+
Error: "an Error",
|
|
80
|
+
Map: "a Map",
|
|
81
|
+
Set: "a Set",
|
|
82
|
+
String: "a String object",
|
|
83
|
+
Number: "a Number object",
|
|
84
|
+
Boolean: "a Boolean object",
|
|
85
|
+
Promise: "a Promise",
|
|
86
|
+
WeakMap: "a WeakMap",
|
|
87
|
+
WeakSet: "a WeakSet"
|
|
88
|
+
};
|
|
89
|
+
export const platformDescriptions = {
|
|
90
|
+
ArrayBuffer: "an ArrayBuffer instance",
|
|
91
|
+
Blob: "a Blob instance",
|
|
92
|
+
File: "a File instance",
|
|
93
|
+
FormData: "a FormData instance",
|
|
94
|
+
Headers: "a Headers instance",
|
|
95
|
+
Request: "a Request instance",
|
|
96
|
+
Response: "a Response instance",
|
|
97
|
+
URL: "a URL instance"
|
|
98
|
+
};
|
|
99
|
+
export const typedArrayDescriptions = {
|
|
100
|
+
Int8Array: "an Int8Array",
|
|
101
|
+
Uint8Array: "a Uint8Array",
|
|
102
|
+
Uint8ClampedArray: "a Uint8ClampedArray",
|
|
103
|
+
Int16Array: "an Int16Array",
|
|
104
|
+
Uint16Array: "a Uint16Array",
|
|
105
|
+
Int32Array: "an Int32Array",
|
|
106
|
+
Uint32Array: "a Uint32Array",
|
|
107
|
+
Float32Array: "a Float32Array",
|
|
108
|
+
Float64Array: "a Float64Array",
|
|
109
|
+
BigInt64Array: "a BigInt64Array",
|
|
110
|
+
BigUint64Array: "a BigUint64Array"
|
|
111
|
+
};
|
|
112
|
+
/** Each defaultObjectKind's completion for the phrase "must be _____" */
|
|
113
|
+
export const objectKindDescriptions = {
|
|
114
|
+
...ecmascriptDescriptions,
|
|
115
|
+
...platformDescriptions,
|
|
116
|
+
...typedArrayDescriptions
|
|
117
|
+
};
|
|
118
|
+
/**
|
|
119
|
+
* this will only return an object kind if it's the root constructor
|
|
120
|
+
* example TypeError would return null not 'Error'
|
|
121
|
+
**/
|
|
122
|
+
export const getBuiltinNameOfConstructor = (ctor) => {
|
|
123
|
+
const constructorName = Object(ctor).name ?? null;
|
|
124
|
+
return (constructorName &&
|
|
125
|
+
isKeyOf(constructorName, builtinConstructors) &&
|
|
126
|
+
builtinConstructors[constructorName] === ctor) ?
|
|
127
|
+
constructorName
|
|
128
|
+
: null;
|
|
129
|
+
};
|
|
130
|
+
/**
|
|
131
|
+
* Returns an array of constructors for all ancestors (i.e., prototypes) of a given object.
|
|
132
|
+
*/
|
|
133
|
+
export const ancestorsOf = (o) => {
|
|
134
|
+
let proto = Object.getPrototypeOf(o);
|
|
135
|
+
const result = [];
|
|
136
|
+
while (proto !== null) {
|
|
137
|
+
result.push(proto.constructor);
|
|
138
|
+
proto = Object.getPrototypeOf(proto);
|
|
139
|
+
}
|
|
140
|
+
return result;
|
|
141
|
+
};
|
|
142
|
+
export const constructorExtends = (ctor, base) => {
|
|
143
|
+
let current = ctor.prototype;
|
|
144
|
+
while (current !== null) {
|
|
145
|
+
if (current === base.prototype)
|
|
146
|
+
return true;
|
|
147
|
+
current = Object.getPrototypeOf(current);
|
|
148
|
+
}
|
|
149
|
+
return false;
|
|
150
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ReadonlyArray, type array } from "./arrays.ts";
|
|
2
|
+
import type { requireKeys } from "./records.ts";
|
|
3
|
+
import { type JsonArray } from "./serialize.ts";
|
|
4
|
+
export type StringifyPathOptions<stringifiable = PropertyKey> = requireKeys<{
|
|
5
|
+
stringifySymbol?: (s: symbol) => string;
|
|
6
|
+
stringifyNonKey?: (o: Exclude<stringifiable, PropertyKey>) => string;
|
|
7
|
+
}, stringifiable extends PropertyKey ? never : "stringifyNonKey">;
|
|
8
|
+
export type StringifyPathFn = <stringifiable>(path: array<stringifiable>, ...[opts]: [stringifiable] extends [PropertyKey] ? [
|
|
9
|
+
opts?: StringifyPathOptions
|
|
10
|
+
] : NoInfer<[opts: StringifyPathOptions<stringifiable>]>) => string;
|
|
11
|
+
export type AppendStringifiedKeyFn = <stringifiable>(path: string, prop: stringifiable, ...[opts]: [stringifiable] extends [PropertyKey] ? [
|
|
12
|
+
opts?: StringifyPathOptions
|
|
13
|
+
] : NoInfer<[opts: StringifyPathOptions<stringifiable>]>) => string;
|
|
14
|
+
export declare const appendStringifiedKey: AppendStringifiedKeyFn;
|
|
15
|
+
export declare const stringifyPath: StringifyPathFn;
|
|
16
|
+
export declare class ReadonlyPath extends ReadonlyArray<PropertyKey> {
|
|
17
|
+
private cache;
|
|
18
|
+
constructor(...items: array<PropertyKey>);
|
|
19
|
+
toJSON(): JsonArray;
|
|
20
|
+
stringify(): string;
|
|
21
|
+
stringifyAncestors(): readonly string[];
|
|
22
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { ReadonlyArray } from "./arrays.js";
|
|
2
|
+
import { throwParseError } from "./errors.js";
|
|
3
|
+
import { isDotAccessible } from "./registry.js";
|
|
4
|
+
import { printable } from "./serialize.js";
|
|
5
|
+
export const appendStringifiedKey = (path, prop, ...[opts]) => {
|
|
6
|
+
const stringifySymbol = opts?.stringifySymbol ?? printable;
|
|
7
|
+
let propAccessChain = path;
|
|
8
|
+
switch (typeof prop) {
|
|
9
|
+
case "string":
|
|
10
|
+
propAccessChain =
|
|
11
|
+
isDotAccessible(prop) ?
|
|
12
|
+
path === "" ?
|
|
13
|
+
prop
|
|
14
|
+
: `${path}.${prop}`
|
|
15
|
+
: `${path}[${JSON.stringify(prop)}]`;
|
|
16
|
+
break;
|
|
17
|
+
case "number":
|
|
18
|
+
propAccessChain = `${path}[${prop}]`;
|
|
19
|
+
break;
|
|
20
|
+
case "symbol":
|
|
21
|
+
propAccessChain = `${path}[${stringifySymbol(prop)}]`;
|
|
22
|
+
break;
|
|
23
|
+
default:
|
|
24
|
+
if (opts?.stringifyNonKey)
|
|
25
|
+
propAccessChain = `${path}[${opts.stringifyNonKey(prop)}]`;
|
|
26
|
+
else {
|
|
27
|
+
throwParseError(`${printable(prop)} must be a PropertyKey or stringifyNonKey must be passed to options`);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return propAccessChain;
|
|
31
|
+
};
|
|
32
|
+
export const stringifyPath = (path, ...opts) => path.reduce((s, k) => appendStringifiedKey(s, k, ...opts), "");
|
|
33
|
+
export class ReadonlyPath extends ReadonlyArray {
|
|
34
|
+
// alternate strategy for caching since the base object is frozen
|
|
35
|
+
cache = {};
|
|
36
|
+
constructor(...items) {
|
|
37
|
+
super();
|
|
38
|
+
this.push(...items);
|
|
39
|
+
}
|
|
40
|
+
toJSON() {
|
|
41
|
+
if (this.cache.json)
|
|
42
|
+
return this.cache.json;
|
|
43
|
+
this.cache.json = [];
|
|
44
|
+
for (let i = 0; i < this.length; i++) {
|
|
45
|
+
this.cache.json.push(typeof this[i] === "symbol" ? printable(this[i]) : this[i]);
|
|
46
|
+
}
|
|
47
|
+
return this.cache.json;
|
|
48
|
+
}
|
|
49
|
+
stringify() {
|
|
50
|
+
if (this.cache.stringify)
|
|
51
|
+
return this.cache.stringify;
|
|
52
|
+
return (this.cache.stringify = stringifyPath(this));
|
|
53
|
+
}
|
|
54
|
+
stringifyAncestors() {
|
|
55
|
+
if (this.cache.stringifyAncestors)
|
|
56
|
+
return this.cache.stringifyAncestors;
|
|
57
|
+
let propString = "";
|
|
58
|
+
const result = [propString];
|
|
59
|
+
for (const path of this) {
|
|
60
|
+
propString = appendStringifiedKey(propString, path);
|
|
61
|
+
result.push(propString);
|
|
62
|
+
}
|
|
63
|
+
return (this.cache.stringifyAncestors = result);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { inferDomain } from "./domain.ts";
|
|
2
|
+
import type { BigintLiteral } from "./numbers.ts";
|
|
3
|
+
type SerializedString<value extends string = string> = `"${value}"`;
|
|
4
|
+
export type SerializedPrimitives = {
|
|
5
|
+
string: SerializedString;
|
|
6
|
+
number: `${number}`;
|
|
7
|
+
bigint: BigintLiteral;
|
|
8
|
+
boolean: "true" | "false";
|
|
9
|
+
null: "null";
|
|
10
|
+
undefined: "undefined";
|
|
11
|
+
};
|
|
12
|
+
export type SerializedPrimitive = SerializedPrimitives[keyof SerializedPrimitives];
|
|
13
|
+
export type SerializablePrimitive = inferDomain<keyof SerializedPrimitives>;
|
|
14
|
+
export declare const serializePrimitive: <value extends SerializablePrimitive>(value: value) => serializePrimitive<value>;
|
|
15
|
+
export type serializePrimitive<value extends SerializablePrimitive> = value extends string ? `"${value}"` : value extends bigint ? `${value}n` : `${value}`;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import type { array } from "./arrays.ts";
|
|
2
|
+
import type { Primitive } from "./domain.ts";
|
|
3
|
+
import type { Fn } from "./functions.ts";
|
|
4
|
+
import type { defined, show } from "./generics.ts";
|
|
5
|
+
import type { Key } from "./keys.ts";
|
|
6
|
+
import type { intersectUnion } from "./unionToTuple.ts";
|
|
7
|
+
export type Dict<k extends string = string, v = unknown> = {
|
|
8
|
+
readonly [_ in k]: v;
|
|
9
|
+
};
|
|
10
|
+
export type dict<v = unknown, k extends string = string> = {
|
|
11
|
+
[_ in k]: v;
|
|
12
|
+
};
|
|
13
|
+
/** Either:
|
|
14
|
+
* A, with all properties of B undefined
|
|
15
|
+
* OR
|
|
16
|
+
* B, with all properties of A undefined
|
|
17
|
+
**/
|
|
18
|
+
export type propwiseXor<a, b> = show<a & {
|
|
19
|
+
[k in keyof b]?: undefined;
|
|
20
|
+
}> | show<b & {
|
|
21
|
+
[k in keyof a]?: undefined;
|
|
22
|
+
}>;
|
|
23
|
+
export type unionToPropwiseXor<props extends object, branchKey extends PropertyKey = keyof intersectUnion<props>> = props extends infer distributed ? show<distributed & {
|
|
24
|
+
[k in branchKey]?: k extends keyof distributed ? unknown : undefined;
|
|
25
|
+
}> : never;
|
|
26
|
+
export type requireKeys<o, key extends keyof o> = o & {
|
|
27
|
+
[requiredKey in key]-?: defined<o[requiredKey]>;
|
|
28
|
+
};
|
|
29
|
+
export type require<o, maxDepth extends number = 1> = _require<o, [], maxDepth>;
|
|
30
|
+
type _require<o, depth extends 1[], maxDepth extends number> = depth["length"] extends maxDepth ? o : o extends object ? o extends Fn ? o : {
|
|
31
|
+
[k in keyof o]-?: _require<o[k], [...depth, 1], maxDepth>;
|
|
32
|
+
} : o;
|
|
33
|
+
export type PartialRecord<k extends PropertyKey = PropertyKey, v = unknown> = {
|
|
34
|
+
[_ in k]?: v;
|
|
35
|
+
};
|
|
36
|
+
/** Returns true if a type can be homomorphically mapped without losing information.
|
|
37
|
+
* Useful for avoiding e.g. classes with private properties while mapping.
|
|
38
|
+
*/
|
|
39
|
+
export type isSafelyMappable<t> = {
|
|
40
|
+
[k in keyof t]: t[k];
|
|
41
|
+
} extends t ? true : false;
|
|
42
|
+
export type KeySet<key extends string = string> = {
|
|
43
|
+
readonly [_ in key]?: 1;
|
|
44
|
+
};
|
|
45
|
+
export type keySetOf<o extends object> = KeySet<Extract<keyof o, string>>;
|
|
46
|
+
export type mutable<o, maxDepth extends number = 1> = _mutable<o, [], maxDepth>;
|
|
47
|
+
type _mutable<o, depth extends 1[], maxDepth extends number> = depth["length"] extends maxDepth ? o : o extends Primitive ? o : o extends Fn ? o : {
|
|
48
|
+
-readonly [k in keyof o]: _mutable<o[k], [...depth, 1], maxDepth>;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* extracts entries mimicking Object.entries, accounting for whether the
|
|
52
|
+
* object is an array
|
|
53
|
+
**/
|
|
54
|
+
export type entryOf<o> = {
|
|
55
|
+
[k in keyof o]-?: [k, o[k] & ({} | null)];
|
|
56
|
+
}[o extends readonly unknown[] ? keyof o & number : keyof o] & unknown;
|
|
57
|
+
export type entriesOf<o extends object> = entryOf<o>[];
|
|
58
|
+
/**
|
|
59
|
+
* Object.entries wrapper providing narrowed types for objects with known sets
|
|
60
|
+
* of keys, e.g. those defined internally as configs
|
|
61
|
+
*/
|
|
62
|
+
export declare const entriesOf: <o extends object>(o: o) => entryOf<o>[];
|
|
63
|
+
export type Entry<key extends PropertyKey = PropertyKey, value = unknown> = readonly [key: key, value: value];
|
|
64
|
+
export type fromEntries<entries extends readonly Entry[]> = show<{
|
|
65
|
+
[entry in entries[number] as entry[0]]: entry[1];
|
|
66
|
+
}>;
|
|
67
|
+
export declare const fromEntries: <const entries extends readonly Entry[]>(entries: entries) => fromEntries<entries>;
|
|
68
|
+
/** Mimics the result of Object.keys(...) */
|
|
69
|
+
export type keyOf<o> = o extends array ? number extends o["length"] ? `${number}` : keyof o & `${number}` : keyof o extends infer k ? k extends string ? k : k extends number ? `${k}` : never : never;
|
|
70
|
+
export declare const keysOf: <o extends object>(o: o) => keyOf<o>[];
|
|
71
|
+
export declare const isKeyOf: <k extends string | number | symbol, o extends object>(k: k, o: o) => k is Extract<keyof o, k>;
|
|
72
|
+
/** Coalesce keys that exist on one or more branches of a union */
|
|
73
|
+
export type unionKeyOf<t> = t extends unknown ? keyof t : never;
|
|
74
|
+
export type extractKeyed<o extends object, k extends unionKeyOf<o>> = Extract<o, {
|
|
75
|
+
[_ in k]?: unknown;
|
|
76
|
+
}>;
|
|
77
|
+
export declare const hasKey: <o extends object, k extends unionKeyOf<o>>(o: o, k: k) => o is extractKeyed<o, k>;
|
|
78
|
+
export type extractDefinedKey<o extends object, k extends unionKeyOf<o>> = show<extractKeyed<o, k> & {
|
|
79
|
+
[_ in k]: {} | null;
|
|
80
|
+
}>;
|
|
81
|
+
export declare const hasDefinedKey: <o extends object, k extends unionKeyOf<o>>(o: o, k: k) => o is extractDefinedKey<o, k>;
|
|
82
|
+
export type requiredKeyOf<o> = keyof o extends infer k ? k extends keyof o ? o extends {
|
|
83
|
+
[_ in k]-?: o[k];
|
|
84
|
+
} ? k : never : never : never;
|
|
85
|
+
export type optionalKeyOf<o> = Exclude<keyof o, requiredKeyOf<o>>;
|
|
86
|
+
export type merge<base, props> = base extends unknown ? props extends unknown ? keyof base & keyof props extends never ? show<base & props> : show<omit<base, keyof props & keyof base> & props> : never : never;
|
|
87
|
+
export type override<base, merged extends {
|
|
88
|
+
[k in keyof base]?: unknown;
|
|
89
|
+
}> = merge<base, merged>;
|
|
90
|
+
export type propValueOf<o> = o[keyof o];
|
|
91
|
+
export declare const InnerDynamicBase: new <t extends object>(base: t) => t;
|
|
92
|
+
export declare class Covariant<t> {
|
|
93
|
+
/**
|
|
94
|
+
* Patterns of the form `interface Example<T> extends T {}` don't count as using `T`.
|
|
95
|
+
* From tsc's point of view when calculating variance it may as well look like `interface Example<T> {}`.
|
|
96
|
+
* Fundamentally this ordinarily means `Example<T>` will always be assignable to `Example<U>` and
|
|
97
|
+
* vice versa.
|
|
98
|
+
*
|
|
99
|
+
* Obviously this is a problem, so `Covariant` exists to add an unobtrusive covariant usage of the type
|
|
100
|
+
* parameter, making `Example<T>` assignable to `Example<U>` only if `T` is a subtype of `U`.
|
|
101
|
+
*/
|
|
102
|
+
private " covariant"?;
|
|
103
|
+
}
|
|
104
|
+
/** @ts-ignore (needed to extend `t`) **/
|
|
105
|
+
export interface DynamicBase<t extends object> extends t, Covariant<t> {
|
|
106
|
+
}
|
|
107
|
+
export declare class DynamicBase<t extends object> {
|
|
108
|
+
constructor(properties: t);
|
|
109
|
+
}
|
|
110
|
+
export declare const NoopBase: new <t extends object>() => t;
|
|
111
|
+
/** @ts-ignore (needed to extend `t`) **/
|
|
112
|
+
export declare class CastableBase<t extends object> extends NoopBase<t> {
|
|
113
|
+
private " covariant"?;
|
|
114
|
+
}
|
|
115
|
+
export declare const splitByKeys: <o extends object, leftKeys extends keySetOf<o>>(o: o, leftKeys: leftKeys) => [show<Pick<o, keyof leftKeys & keyof o>>, show<Omit<o, keyof leftKeys & keyof o>>];
|
|
116
|
+
/** Homomorphic implementation of the builtin Pick.
|
|
117
|
+
*
|
|
118
|
+
* Gives different results for certain union expressions like the following:
|
|
119
|
+
*
|
|
120
|
+
* @example
|
|
121
|
+
* // flattens result to { a?: 1 | 2; b?: 1 | 2 }
|
|
122
|
+
* type PickResult = Pick<{ a: 1; b?: 1 } | { a?: 2; b: 2 }, "a" | "b">
|
|
123
|
+
*
|
|
124
|
+
* @example
|
|
125
|
+
* // preserves original type w/ modifier groupings
|
|
126
|
+
* type pickResult = pick<{ a: 1; b?: 1 } | { a?: 2; b: 2 }, "a" | "b">
|
|
127
|
+
*/
|
|
128
|
+
export type pick<o, key extends keyof o> = o extends unknown ? {
|
|
129
|
+
[k in keyof o as k extends key ? k : never]: o[k];
|
|
130
|
+
} : never;
|
|
131
|
+
export declare const pick: <o extends object, keys extends keySetOf<o>>(o: o, keys: keys) => pick<o, keyof keys & keyof o>;
|
|
132
|
+
/** Homomorphic implementation of the builtin Omit.
|
|
133
|
+
*
|
|
134
|
+
* Gives different results for many union expressions like the following:
|
|
135
|
+
*
|
|
136
|
+
* @example
|
|
137
|
+
* // {}
|
|
138
|
+
* type OmitResult = Omit<{ a: 1 } | { b: 2 }, never>
|
|
139
|
+
*
|
|
140
|
+
* @example
|
|
141
|
+
* // preserves original type w/ modifier groupings
|
|
142
|
+
* type omitResult = omit<{ a: 1 } | { b: 2 }, never>
|
|
143
|
+
*/
|
|
144
|
+
export type omit<o, key extends keyof o> = {
|
|
145
|
+
[k in keyof o as k extends key ? never : k]: o[k];
|
|
146
|
+
};
|
|
147
|
+
export declare const omit: <o extends object, keys extends keySetOf<o>>(o: o, keys: keys) => omit<o, keyof keys & keyof o>;
|
|
148
|
+
/** Returns onTrue if the type is exactly `{}` and onFalse otherwise*/
|
|
149
|
+
export type ifEmptyObjectLiteral<t, onTrue = true, onFalse = false> = [
|
|
150
|
+
unknown,
|
|
151
|
+
t & (null | undefined)
|
|
152
|
+
] extends [t | null | undefined, never] ? onTrue : onFalse;
|
|
153
|
+
export type EmptyObject = Record<PropertyKey, never>;
|
|
154
|
+
export declare const isEmptyObject: (o: object) => o is EmptyObject;
|
|
155
|
+
export declare const stringAndSymbolicEntriesOf: (o: object) => Entry<Key>[];
|
|
156
|
+
/** Like Object.assign, but it will preserve getters instead of evaluating them. */
|
|
157
|
+
export declare const defineProperties: <base extends object, merged extends object>(base: base, merged: merged) => merge<base, merged>;
|
|
158
|
+
/** Copies enumerable keys of o to a new object in alphabetical order */
|
|
159
|
+
export declare const withAlphabetizedKeys: <o extends object>(o: o) => o;
|
|
160
|
+
export type invert<t extends Record<PropertyKey, PropertyKey>> = {
|
|
161
|
+
[k in t[keyof t]]: {
|
|
162
|
+
[k2 in keyof t]: t[k2] extends k ? k2 : never;
|
|
163
|
+
}[keyof t];
|
|
164
|
+
} & unknown;
|
|
165
|
+
export declare const invert: <t extends Record<PropertyKey, PropertyKey>>(t: t) => invert<t>;
|
|
166
|
+
export declare const unset: " unset";
|
|
167
|
+
export type unset = typeof unset;
|
|
168
|
+
/**
|
|
169
|
+
* For each keyof o that also exists on jsDocSource, add associated JsDoc annotations to o.
|
|
170
|
+
* Does not preserve modifiers on o like optionality.
|
|
171
|
+
*/
|
|
172
|
+
export type withJsDoc<o, jsDocSource> = show<keyof o extends keyof jsDocSource ? keyof jsDocSource extends keyof o ? _withJsDoc<o, jsDocSource> : Pick<_withJsDoc<o, jsDocSource>, keyof o & keyof jsDocSource> : Pick<_withJsDoc<o, jsDocSource>, keyof o & keyof jsDocSource> & {
|
|
173
|
+
[k in Exclude<keyof o, keyof jsDocSource>]: o[k];
|
|
174
|
+
}>;
|
|
175
|
+
type _withJsDoc<o, jsDocSource> = {
|
|
176
|
+
[k in keyof jsDocSource]-?: o[k & keyof o];
|
|
177
|
+
};
|
|
178
|
+
export type propertyDescriptorsOf<o extends object> = {
|
|
179
|
+
[k in keyof o]: TypedPropertyDescriptor<o[k]>;
|
|
180
|
+
};
|
|
181
|
+
export type keyWithValue<t, constraint> = keyof t extends infer k ? k extends keyof t ? t[k] extends constraint ? k : never : never : never;
|
|
182
|
+
export declare const enumValues: <tsEnum extends object>(tsEnum: tsEnum) => tsEnum[keyof tsEnum][];
|
|
183
|
+
export {};
|