@integration-app/react 0.1.1 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- package/node_modules/@compwright/namecase/LICENSE +26 -0
- package/node_modules/@compwright/namecase/README.md +49 -0
- package/node_modules/@compwright/namecase/bin/namecase +28 -0
- package/node_modules/@compwright/namecase/dist/namecase.min.js +4 -0
- package/node_modules/@compwright/namecase/dist/namecase.min.js.map +1 -0
- package/node_modules/@compwright/namecase/package.json +46 -0
- package/node_modules/@compwright/namecase/src/index.js +146 -0
- package/node_modules/@integration-app/sdk/bundle.js +404 -262
- package/node_modules/@integration-app/sdk/bundle.js.map +1 -1
- package/node_modules/@integration-app/sdk/client.d.ts +3 -3
- package/node_modules/@integration-app/sdk/data-builder/formulas/case.d.ts +3 -7
- package/node_modules/@integration-app/sdk/data-builder/formulas/case.js +16 -32
- package/node_modules/@integration-app/sdk/data-builder/formulas/case.js.map +1 -1
- package/node_modules/@integration-app/sdk/integrations/accessors.d.ts +0 -6
- package/node_modules/@integration-app/sdk/integrations/accessors.js +1 -87
- package/node_modules/@integration-app/sdk/integrations/accessors.js.map +1 -1
- package/node_modules/@integration-app/sdk/json-schema/index.d.ts +1 -1
- package/node_modules/@integration-app/sdk/src/client.ts +3 -3
- package/node_modules/@integration-app/sdk/src/data-builder/formulas/case.test.ts +11 -113
- package/node_modules/@integration-app/sdk/src/data-builder/formulas/case.ts +22 -46
- package/node_modules/@integration-app/sdk/src/integrations/accessors.ts +2 -122
- package/node_modules/@sinclair/typebox/package.json +40 -0
- package/node_modules/@sinclair/typebox/readme.md +740 -0
- package/node_modules/@sinclair/typebox/typebox.d.ts +351 -0
- package/node_modules/@sinclair/typebox/typebox.js +345 -0
- package/node_modules/@types/node/README.md +16 -0
- package/node_modules/@types/node/assert.d.ts +128 -0
- package/node_modules/@types/node/async_hooks.d.ts +229 -0
- package/node_modules/@types/node/buffer.d.ts +89 -0
- package/node_modules/@types/node/child_process.d.ts +514 -0
- package/node_modules/@types/node/cluster.d.ts +265 -0
- package/node_modules/@types/node/console.d.ts +142 -0
- package/node_modules/@types/node/constants.d.ts +18 -0
- package/node_modules/@types/node/crypto.d.ts +1283 -0
- package/node_modules/@types/node/dgram.d.ts +144 -0
- package/node_modules/@types/node/dns.d.ts +387 -0
- package/node_modules/@types/node/domain.d.ts +27 -0
- package/node_modules/@types/node/events.d.ts +82 -0
- package/node_modules/@types/node/fs/promises.d.ts +572 -0
- package/node_modules/@types/node/fs.d.ts +2281 -0
- package/node_modules/@types/node/globals.d.ts +747 -0
- package/node_modules/@types/node/globals.global.d.ts +1 -0
- package/node_modules/@types/node/http.d.ts +580 -0
- package/node_modules/@types/node/http2.d.ts +962 -0
- package/node_modules/@types/node/https.d.ts +271 -0
- package/node_modules/@types/node/index.d.ts +98 -0
- package/node_modules/@types/node/inspector.d.ts +3051 -0
- package/node_modules/@types/node/module.d.ts +56 -0
- package/node_modules/@types/node/net.d.ts +308 -0
- package/node_modules/@types/node/os.d.ts +243 -0
- package/node_modules/@types/node/package.json +232 -0
- package/node_modules/@types/node/path.d.ts +168 -0
- package/node_modules/@types/node/perf_hooks.d.ts +274 -0
- package/node_modules/@types/node/process.d.ts +413 -0
- package/node_modules/@types/node/punycode.d.ts +78 -0
- package/node_modules/@types/node/querystring.d.ts +31 -0
- package/node_modules/@types/node/readline.d.ts +174 -0
- package/node_modules/@types/node/repl.d.ts +398 -0
- package/node_modules/@types/node/stream.d.ts +359 -0
- package/node_modules/@types/node/string_decoder.d.ts +10 -0
- package/node_modules/@types/node/timers.d.ts +19 -0
- package/node_modules/@types/node/tls.d.ts +784 -0
- package/node_modules/@types/node/trace_events.d.ts +64 -0
- package/node_modules/@types/node/ts4.8/assert.d.ts +128 -0
- package/node_modules/@types/node/ts4.8/async_hooks.d.ts +229 -0
- package/node_modules/@types/node/ts4.8/buffer.d.ts +89 -0
- package/node_modules/@types/node/ts4.8/child_process.d.ts +514 -0
- package/node_modules/@types/node/ts4.8/cluster.d.ts +265 -0
- package/node_modules/@types/node/ts4.8/console.d.ts +142 -0
- package/node_modules/@types/node/ts4.8/constants.d.ts +18 -0
- package/node_modules/@types/node/ts4.8/crypto.d.ts +1283 -0
- package/node_modules/@types/node/ts4.8/dgram.d.ts +144 -0
- package/node_modules/@types/node/ts4.8/dns.d.ts +387 -0
- package/node_modules/@types/node/ts4.8/domain.d.ts +27 -0
- package/node_modules/@types/node/ts4.8/events.d.ts +82 -0
- package/node_modules/@types/node/ts4.8/fs/promises.d.ts +572 -0
- package/node_modules/@types/node/ts4.8/fs.d.ts +2281 -0
- package/node_modules/@types/node/ts4.8/globals.d.ts +746 -0
- package/node_modules/@types/node/ts4.8/globals.global.d.ts +1 -0
- package/node_modules/@types/node/ts4.8/http.d.ts +580 -0
- package/node_modules/@types/node/ts4.8/http2.d.ts +962 -0
- package/node_modules/@types/node/ts4.8/https.d.ts +271 -0
- package/node_modules/@types/node/ts4.8/index.d.ts +53 -0
- package/node_modules/@types/node/ts4.8/inspector.d.ts +3051 -0
- package/node_modules/@types/node/ts4.8/module.d.ts +56 -0
- package/node_modules/@types/node/ts4.8/net.d.ts +308 -0
- package/node_modules/@types/node/ts4.8/os.d.ts +243 -0
- package/node_modules/@types/node/ts4.8/path.d.ts +168 -0
- package/node_modules/@types/node/ts4.8/perf_hooks.d.ts +274 -0
- package/node_modules/@types/node/ts4.8/process.d.ts +413 -0
- package/node_modules/@types/node/ts4.8/punycode.d.ts +78 -0
- package/node_modules/@types/node/ts4.8/querystring.d.ts +31 -0
- package/node_modules/@types/node/ts4.8/readline.d.ts +174 -0
- package/node_modules/@types/node/ts4.8/repl.d.ts +398 -0
- package/node_modules/@types/node/ts4.8/stream.d.ts +359 -0
- package/node_modules/@types/node/ts4.8/string_decoder.d.ts +10 -0
- package/node_modules/@types/node/ts4.8/timers.d.ts +19 -0
- package/node_modules/@types/node/ts4.8/tls.d.ts +784 -0
- package/node_modules/@types/node/ts4.8/trace_events.d.ts +64 -0
- package/node_modules/@types/node/ts4.8/tty.d.ts +69 -0
- package/node_modules/@types/node/ts4.8/url.d.ts +149 -0
- package/node_modules/@types/node/ts4.8/util.d.ts +216 -0
- package/node_modules/@types/node/ts4.8/v8.d.ts +190 -0
- package/node_modules/@types/node/ts4.8/vm.d.ts +155 -0
- package/node_modules/@types/node/ts4.8/wasi.d.ts +89 -0
- package/node_modules/@types/node/ts4.8/worker_threads.d.ts +241 -0
- package/node_modules/@types/node/ts4.8/zlib.d.ts +364 -0
- package/node_modules/@types/node/tty.d.ts +69 -0
- package/node_modules/@types/node/url.d.ts +149 -0
- package/node_modules/@types/node/util.d.ts +216 -0
- package/node_modules/@types/node/v8.d.ts +190 -0
- package/node_modules/@types/node/vm.d.ts +155 -0
- package/node_modules/@types/node/wasi.d.ts +89 -0
- package/node_modules/@types/node/worker_threads.d.ts +241 -0
- package/node_modules/@types/node/zlib.d.ts +364 -0
- package/package.json +2 -5
- package/node_modules/@integration-app/sdk/.DS_Store +0 -0
- package/node_modules/@integration-app/sdk/.gitignore +0 -11
- package/node_modules/@integration-app/sdk/.npmignore +0 -0
- package/node_modules/@integration-app/sdk/app-data-collections/app-data-collections.d.ts +0 -23
- package/node_modules/@integration-app/sdk/app-data-collections/app-data-collections.js.map +0 -1
- package/node_modules/@integration-app/sdk/app-data-schemas/app-data-schemas.d.ts +0 -20
- package/node_modules/@integration-app/sdk/app-data-schemas/app-data-schemas.js.map +0 -1
- package/node_modules/@integration-app/sdk/app-events/app-events.d.ts +0 -44
- package/node_modules/@integration-app/sdk/app-events/app-events.js.map +0 -1
- package/node_modules/@integration-app/sdk/connection-client.d.ts +0 -12
- package/node_modules/@integration-app/sdk/connection-client.js +0 -31
- package/node_modules/@integration-app/sdk/connection-client.js.map +0 -1
- package/node_modules/@integration-app/sdk/connections/connections.d.ts +0 -46
- package/node_modules/@integration-app/sdk/connections/connections.js.map +0 -1
- package/node_modules/@integration-app/sdk/connector-api/connector-api.d.ts +0 -157
- package/node_modules/@integration-app/sdk/connector-api/connector-api.js.map +0 -1
- package/node_modules/@integration-app/sdk/data-builder/findExternalRecordId.d.ts +0 -0
- package/node_modules/@integration-app/sdk/data-builder/findExternalRecordId.js.map +0 -1
- package/node_modules/@integration-app/sdk/data-builder/first-name.test.d.ts +0 -0
- package/node_modules/@integration-app/sdk/data-builder/first-name.test.js +0 -2
- package/node_modules/@integration-app/sdk/data-builder/first-name.test.js.map +0 -1
- package/node_modules/@integration-app/sdk/data-builder/formulas/anyOfOption.d.ts +0 -10
- package/node_modules/@integration-app/sdk/data-builder/formulas/anyOfOption.js.map +0 -1
- package/node_modules/@integration-app/sdk/data-builder/formulas/base.test.d.ts +0 -1
- package/node_modules/@integration-app/sdk/data-builder/formulas/base.test.js +0 -26
- package/node_modules/@integration-app/sdk/data-builder/formulas/base.test.js.map +0 -1
- package/node_modules/@integration-app/sdk/data-builder/formulas/case.test.d.ts +0 -1
- package/node_modules/@integration-app/sdk/data-builder/formulas/case.test.js +0 -246
- package/node_modules/@integration-app/sdk/data-builder/formulas/case.test.js.map +0 -1
- package/node_modules/@integration-app/sdk/data-builder/formulas/concat.test.d.ts +0 -1
- package/node_modules/@integration-app/sdk/data-builder/formulas/concat.test.js +0 -85
- package/node_modules/@integration-app/sdk/data-builder/formulas/concat.test.js.map +0 -1
- package/node_modules/@integration-app/sdk/data-builder/formulas/copy.test.d.ts +0 -1
- package/node_modules/@integration-app/sdk/data-builder/formulas/copy.test.js +0 -64
- package/node_modules/@integration-app/sdk/data-builder/formulas/copy.test.js.map +0 -1
- package/node_modules/@integration-app/sdk/data-builder/formulas/extractDate.test.d.ts +0 -1
- package/node_modules/@integration-app/sdk/data-builder/formulas/extractDate.test.js +0 -44
- package/node_modules/@integration-app/sdk/data-builder/formulas/extractDate.test.js.map +0 -1
- package/node_modules/@integration-app/sdk/data-builder/formulas/extractTime.test.d.ts +0 -1
- package/node_modules/@integration-app/sdk/data-builder/formulas/extractTime.test.js +0 -44
- package/node_modules/@integration-app/sdk/data-builder/formulas/extractTime.test.js.map +0 -1
- package/node_modules/@integration-app/sdk/data-builder/formulas/findAppRecordId.test.d.ts +0 -1
- package/node_modules/@integration-app/sdk/data-builder/formulas/findAppRecordId.test.js +0 -26
- package/node_modules/@integration-app/sdk/data-builder/formulas/findAppRecordId.test.js.map +0 -1
- package/node_modules/@integration-app/sdk/data-builder/formulas/findExternalRecordId.test.d.ts +0 -1
- package/node_modules/@integration-app/sdk/data-builder/formulas/findExternalRecordId.test.js +0 -26
- package/node_modules/@integration-app/sdk/data-builder/formulas/findExternalRecordId.test.js.map +0 -1
- package/node_modules/@integration-app/sdk/data-builder/formulas/first-name.test.d.ts +0 -1
- package/node_modules/@integration-app/sdk/data-builder/formulas/first-name.test.js +0 -14
- package/node_modules/@integration-app/sdk/data-builder/formulas/first-name.test.js.map +0 -1
- package/node_modules/@integration-app/sdk/data-builder/formulas/index.test.d.ts +0 -1
- package/node_modules/@integration-app/sdk/data-builder/formulas/index.test.js +0 -63
- package/node_modules/@integration-app/sdk/data-builder/formulas/index.test.js.map +0 -1
- package/node_modules/@integration-app/sdk/data-builder/formulas/iterate.test.d.ts +0 -1
- package/node_modules/@integration-app/sdk/data-builder/formulas/iterate.test.js +0 -112
- package/node_modules/@integration-app/sdk/data-builder/formulas/iterate.test.js.map +0 -1
- package/node_modules/@integration-app/sdk/data-builder/formulas/lookup.test.d.ts +0 -1
- package/node_modules/@integration-app/sdk/data-builder/formulas/lookup.test.js +0 -18
- package/node_modules/@integration-app/sdk/data-builder/formulas/lookup.test.js.map +0 -1
- package/node_modules/@integration-app/sdk/data-builder/formulas/map.test.d.ts +0 -1
- package/node_modules/@integration-app/sdk/data-builder/formulas/map.test.js +0 -114
- package/node_modules/@integration-app/sdk/data-builder/formulas/map.test.js.map +0 -1
- package/node_modules/@integration-app/sdk/data-builder/formulas/tpl.test.d.ts +0 -1
- package/node_modules/@integration-app/sdk/data-builder/formulas/tpl.test.js +0 -49
- package/node_modules/@integration-app/sdk/data-builder/formulas/tpl.test.js.map +0 -1
- package/node_modules/@integration-app/sdk/data-builder/formulas/types.d.ts +0 -0
- package/node_modules/@integration-app/sdk/data-builder/formulas/types.js.map +0 -1
- package/node_modules/@integration-app/sdk/data-builder/index.test.d.ts +0 -1
- package/node_modules/@integration-app/sdk/data-builder/index.test.js +0 -295
- package/node_modules/@integration-app/sdk/data-builder/index.test.js.map +0 -1
- package/node_modules/@integration-app/sdk/data-builder/locators.test.d.ts +0 -1
- package/node_modules/@integration-app/sdk/data-builder/locators.test.js +0 -775
- package/node_modules/@integration-app/sdk/data-builder/locators.test.js.map +0 -1
- package/node_modules/@integration-app/sdk/data-filter/conditions.d.ts +0 -0
- package/node_modules/@integration-app/sdk/data-filter/conditions.js.map +0 -1
- package/node_modules/@integration-app/sdk/data-filter/data-filter.test.d.ts +0 -1
- package/node_modules/@integration-app/sdk/data-filter/data-filter.test.js.map +0 -1
- package/node_modules/@integration-app/sdk/data-filter/index.test.d.ts +0 -1
- package/node_modules/@integration-app/sdk/data-filter/index.test.js +0 -43
- package/node_modules/@integration-app/sdk/data-filter/index.test.js.map +0 -1
- package/node_modules/@integration-app/sdk/data-filter/operators.test.d.ts +0 -1
- package/node_modules/@integration-app/sdk/data-filter/operators.test.js +0 -490
- package/node_modules/@integration-app/sdk/data-filter/operators.test.js.map +0 -1
- package/node_modules/@integration-app/sdk/data-links/data-links.d.ts +0 -58
- package/node_modules/@integration-app/sdk/data-links/data-links.js.map +0 -1
- package/node_modules/@integration-app/sdk/data-schema/index.test.d.ts +0 -1
- package/node_modules/@integration-app/sdk/data-schema/index.test.js +0 -86
- package/node_modules/@integration-app/sdk/data-schema/index.test.js.map +0 -1
- package/node_modules/@integration-app/sdk/data-sources/data-sources.d.ts +0 -41
- package/node_modules/@integration-app/sdk/data-sources/data-sources.js.map +0 -1
- package/node_modules/@integration-app/sdk/endpoints/endpoint-spec.d.ts +0 -30
- package/node_modules/@integration-app/sdk/endpoints/endpoint-spec.js.map +0 -1
- package/node_modules/@integration-app/sdk/field-mappings/field-mappings.d.ts +0 -29
- package/node_modules/@integration-app/sdk/field-mappings/field-mappings.js.map +0 -1
- package/node_modules/@integration-app/sdk/flow-runs/flow-runs.d.ts +0 -51
- package/node_modules/@integration-app/sdk/flow-runs/flow-runs.js.map +0 -1
- package/node_modules/@integration-app/sdk/flows/flows.d.ts +0 -156
- package/node_modules/@integration-app/sdk/flows/flows.js.map +0 -1
- package/node_modules/@integration-app/sdk/flows/nodes/data-record-delete-trigger.d.ts +0 -3
- package/node_modules/@integration-app/sdk/flows/nodes/data-record-delete-trigger.js.map +0 -1
- package/node_modules/@integration-app/sdk/flows/nodes/nodes.d.ts +0 -25
- package/node_modules/@integration-app/sdk/flows/nodes/nodes.js.map +0 -1
- package/node_modules/@integration-app/sdk/flows/utils.test.d.ts +0 -1
- package/node_modules/@integration-app/sdk/flows/utils.test.js +0 -62
- package/node_modules/@integration-app/sdk/flows/utils.test.js.map +0 -1
- package/node_modules/@integration-app/sdk/integration-elements/integration-elements.d.ts +0 -21
- package/node_modules/@integration-app/sdk/integration-elements/integration-elements.js.map +0 -1
- package/node_modules/@integration-app/sdk/integrations/integrations.d.ts +0 -48
- package/node_modules/@integration-app/sdk/integrations/integrations.js.map +0 -1
- package/node_modules/@integration-app/sdk/json-schema/json-schema.test.d.ts +0 -1
- package/node_modules/@integration-app/sdk/json-schema/json-schema.test.js +0 -194
- package/node_modules/@integration-app/sdk/json-schema/json-schema.test.js.map +0 -1
- package/node_modules/@integration-app/sdk/json-schema/schema-builder.test.d.ts +0 -1
- package/node_modules/@integration-app/sdk/json-schema/schema-builder.test.js +0 -352
- package/node_modules/@integration-app/sdk/json-schema/schema-builder.test.js.map +0 -1
- package/node_modules/@integration-app/sdk/jwt.test.d.ts +0 -1
- package/node_modules/@integration-app/sdk/jwt.test.js +0 -9
- package/node_modules/@integration-app/sdk/jwt.test.js.map +0 -1
- package/node_modules/@integration-app/sdk/package-lock.json +0 -3834
- package/node_modules/@integration-app/sdk/udm/activities.test.d.ts +0 -1
- package/node_modules/@integration-app/sdk/udm/activities.test.js +0 -40
- package/node_modules/@integration-app/sdk/udm/activities.test.js.map +0 -1
- package/node_modules/@integration-app/sdk/udm/campaign-members.d.ts +0 -45
- package/node_modules/@integration-app/sdk/udm/campaign-members.js +0 -99
- package/node_modules/@integration-app/sdk/udm/campaign-members.js.map +0 -1
- package/node_modules/@integration-app/sdk/udm/contacts.test.d.ts +0 -1
- package/node_modules/@integration-app/sdk/udm/contacts.test.js +0 -136
- package/node_modules/@integration-app/sdk/udm/contacts.test.js.map +0 -1
- package/node_modules/@integration-app/sdk/udm/crm-activities.d.ts +0 -17
- package/node_modules/@integration-app/sdk/udm/crm-activities.js.map +0 -1
- package/node_modules/@integration-app/sdk/udm/crm-activity.d.ts +0 -11
- package/node_modules/@integration-app/sdk/udm/crm-activity.js.map +0 -1
- package/node_modules/@integration-app/sdk/udm/crm-companies.d.ts +0 -14
- package/node_modules/@integration-app/sdk/udm/crm-companies.js.map +0 -1
- package/node_modules/@integration-app/sdk/udm/crm-contact.d.ts +0 -10
- package/node_modules/@integration-app/sdk/udm/crm-contact.js.map +0 -1
- package/node_modules/@integration-app/sdk/udm/crm-contacts.d.ts +0 -16
- package/node_modules/@integration-app/sdk/udm/crm-contacts.js.map +0 -1
- package/node_modules/@integration-app/sdk/udm/crm-deals.d.ts +0 -15
- package/node_modules/@integration-app/sdk/udm/crm-deals.js.map +0 -1
- package/node_modules/@integration-app/sdk/udm/crm-leads.d.ts +0 -16
- package/node_modules/@integration-app/sdk/udm/crm-leads.js.map +0 -1
- package/node_modules/@integration-app/sdk/udm/members.d.ts +0 -45
- package/node_modules/@integration-app/sdk/udm/members.js.map +0 -1
- package/node_modules/@integration-app/sdk/users/users.d.ts +0 -5
- package/node_modules/@integration-app/sdk/users/users.js.map +0 -1
@@ -0,0 +1,345 @@
|
|
1
|
+
"use strict";
|
2
|
+
/*--------------------------------------------------------------------------
|
3
|
+
|
4
|
+
TypeBox: JSON Schema Type Builder with Static Type Resolution for TypeScript
|
5
|
+
|
6
|
+
The MIT License (MIT)
|
7
|
+
|
8
|
+
Copyright (c) 2021 Haydn Paterson (sinclair) <haydn.developer@gmail.com>
|
9
|
+
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
12
|
+
in the Software without restriction, including without limitation the rights
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
15
|
+
furnished to do so, subject to the following conditions:
|
16
|
+
|
17
|
+
The above copyright notice and this permission notice shall be included in
|
18
|
+
all copies or substantial portions of the Software.
|
19
|
+
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
26
|
+
THE SOFTWARE.
|
27
|
+
|
28
|
+
---------------------------------------------------------------------------*/
|
29
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
30
|
+
exports.Type = exports.TypeBuilder = exports.VoidKind = exports.UndefinedKind = exports.PromiseKind = exports.FunctionKind = exports.ConstructorKind = exports.RefKind = exports.AnyKind = exports.UnknownKind = exports.NullKind = exports.BooleanKind = exports.IntegerKind = exports.NumberKind = exports.StringKind = exports.LiteralKind = exports.EnumKind = exports.ArrayKind = exports.RecordKind = exports.ObjectKind = exports.TupleKind = exports.UnionKind = exports.IntersectKind = exports.KeyOfKind = exports.NamespaceKind = exports.ReadonlyModifier = exports.OptionalModifier = exports.ReadonlyOptionalModifier = void 0;
|
31
|
+
// --------------------------------------------------------------------------
|
32
|
+
// Modifiers
|
33
|
+
// --------------------------------------------------------------------------
|
34
|
+
exports.ReadonlyOptionalModifier = Symbol('ReadonlyOptionalModifier');
|
35
|
+
exports.OptionalModifier = Symbol('OptionalModifier');
|
36
|
+
exports.ReadonlyModifier = Symbol('ReadonlyModifier');
|
37
|
+
// --------------------------------------------------------------------------
|
38
|
+
// Schema Standard
|
39
|
+
// --------------------------------------------------------------------------
|
40
|
+
exports.NamespaceKind = Symbol('NamespaceKind');
|
41
|
+
exports.KeyOfKind = Symbol('KeyOfKind');
|
42
|
+
exports.IntersectKind = Symbol('IntersectKind');
|
43
|
+
exports.UnionKind = Symbol('UnionKind');
|
44
|
+
exports.TupleKind = Symbol('TupleKind');
|
45
|
+
exports.ObjectKind = Symbol('ObjectKind');
|
46
|
+
exports.RecordKind = Symbol('RecordKind');
|
47
|
+
exports.ArrayKind = Symbol('ArrayKind');
|
48
|
+
exports.EnumKind = Symbol('EnumKind');
|
49
|
+
exports.LiteralKind = Symbol('LiteralKind');
|
50
|
+
exports.StringKind = Symbol('StringKind');
|
51
|
+
exports.NumberKind = Symbol('NumberKind');
|
52
|
+
exports.IntegerKind = Symbol('IntegerKind');
|
53
|
+
exports.BooleanKind = Symbol('BooleanKind');
|
54
|
+
exports.NullKind = Symbol('NullKind');
|
55
|
+
exports.UnknownKind = Symbol('UnknownKind');
|
56
|
+
exports.AnyKind = Symbol('AnyKind');
|
57
|
+
exports.RefKind = Symbol('RefKind');
|
58
|
+
// --------------------------------------------------------------------------
|
59
|
+
// Extended Schema Types
|
60
|
+
// --------------------------------------------------------------------------
|
61
|
+
exports.ConstructorKind = Symbol('ConstructorKind');
|
62
|
+
exports.FunctionKind = Symbol('FunctionKind');
|
63
|
+
exports.PromiseKind = Symbol('PromiseKind');
|
64
|
+
exports.UndefinedKind = Symbol('UndefinedKind');
|
65
|
+
exports.VoidKind = Symbol('VoidKind');
|
66
|
+
// --------------------------------------------------------------------------
|
67
|
+
// Utility
|
68
|
+
// --------------------------------------------------------------------------
|
69
|
+
function isObject(object) {
|
70
|
+
return typeof object === 'object' && object !== null && !Array.isArray(object);
|
71
|
+
}
|
72
|
+
function isArray(object) {
|
73
|
+
return typeof object === 'object' && object !== null && Array.isArray(object);
|
74
|
+
}
|
75
|
+
function clone(object) {
|
76
|
+
if (isObject(object))
|
77
|
+
return Object.keys(object).reduce((acc, key) => ({ ...acc, [key]: clone(object[key]) }), {});
|
78
|
+
if (isArray(object))
|
79
|
+
return object.map((item) => clone(item));
|
80
|
+
return object;
|
81
|
+
}
|
82
|
+
// --------------------------------------------------------------------------
|
83
|
+
// TypeBuilder
|
84
|
+
// --------------------------------------------------------------------------
|
85
|
+
class TypeBuilder {
|
86
|
+
schemas;
|
87
|
+
constructor() {
|
88
|
+
this.schemas = new Map();
|
89
|
+
}
|
90
|
+
/** `Standard` Modifies an object property to be both readonly and optional */
|
91
|
+
ReadonlyOptional(item) {
|
92
|
+
return { ...item, modifier: exports.ReadonlyOptionalModifier };
|
93
|
+
}
|
94
|
+
/** `Standard` Modifies an object property to be readonly */
|
95
|
+
Readonly(item) {
|
96
|
+
return { ...item, modifier: exports.ReadonlyModifier };
|
97
|
+
}
|
98
|
+
/** `Standard` Modifies an object property to be optional */
|
99
|
+
Optional(item) {
|
100
|
+
return { ...item, modifier: exports.OptionalModifier };
|
101
|
+
}
|
102
|
+
/** `Standard` Creates a type type */
|
103
|
+
Tuple(items, options = {}) {
|
104
|
+
const additionalItems = false;
|
105
|
+
const minItems = items.length;
|
106
|
+
const maxItems = items.length;
|
107
|
+
const schema = ((items.length > 0)
|
108
|
+
? { ...options, kind: exports.TupleKind, type: 'array', items, additionalItems, minItems, maxItems }
|
109
|
+
: { ...options, kind: exports.TupleKind, type: 'array', minItems, maxItems });
|
110
|
+
return this.Store(schema);
|
111
|
+
}
|
112
|
+
/** `Standard` Creates an object type with the given properties */
|
113
|
+
Object(properties, options = {}) {
|
114
|
+
const property_names = Object.keys(properties);
|
115
|
+
const optional = property_names.filter(name => {
|
116
|
+
const candidate = properties[name];
|
117
|
+
return (candidate.modifier &&
|
118
|
+
(candidate.modifier === exports.OptionalModifier ||
|
119
|
+
candidate.modifier === exports.ReadonlyOptionalModifier));
|
120
|
+
});
|
121
|
+
const required_names = property_names.filter(name => !optional.includes(name));
|
122
|
+
const required = (required_names.length > 0) ? required_names : undefined;
|
123
|
+
return this.Store(((required)
|
124
|
+
? { ...options, kind: exports.ObjectKind, type: 'object', properties, required }
|
125
|
+
: { ...options, kind: exports.ObjectKind, type: 'object', properties }));
|
126
|
+
}
|
127
|
+
/** `Standard` Creates an intersect type. */
|
128
|
+
Intersect(items, options = {}) {
|
129
|
+
return this.Store({ ...options, kind: exports.IntersectKind, type: 'object', allOf: items });
|
130
|
+
}
|
131
|
+
/** `Standard` Creates a union type */
|
132
|
+
Union(items, options = {}) {
|
133
|
+
return this.Store({ ...options, kind: exports.UnionKind, anyOf: items });
|
134
|
+
}
|
135
|
+
/** `Standard` Creates an array type */
|
136
|
+
Array(items, options = {}) {
|
137
|
+
return this.Store({ ...options, kind: exports.ArrayKind, type: 'array', items });
|
138
|
+
}
|
139
|
+
/** `Standard` Creates an enum type from a TypeScript enum */
|
140
|
+
Enum(item, options = {}) {
|
141
|
+
const values = Object.keys(item).filter(key => isNaN(key)).map(key => item[key]);
|
142
|
+
const anyOf = values.map(value => typeof value === 'string' ? { type: 'string', const: value } : { type: 'number', const: value });
|
143
|
+
return this.Store({ ...options, kind: exports.EnumKind, anyOf });
|
144
|
+
}
|
145
|
+
/** `Standard` Creates a literal type. Supports string, number and boolean values only */
|
146
|
+
Literal(value, options = {}) {
|
147
|
+
return this.Store({ ...options, kind: exports.LiteralKind, const: value, type: typeof value });
|
148
|
+
}
|
149
|
+
/** `Standard` Creates a string type */
|
150
|
+
String(options = {}) {
|
151
|
+
return this.Store({ ...options, kind: exports.StringKind, type: 'string' });
|
152
|
+
}
|
153
|
+
/** `Standard` Creates a string type from a regular expression */
|
154
|
+
RegEx(regex, options = {}) {
|
155
|
+
return this.String({ ...options, pattern: regex.source });
|
156
|
+
}
|
157
|
+
/** `Standard` Creates a number type */
|
158
|
+
Number(options = {}) {
|
159
|
+
return this.Store({ ...options, kind: exports.NumberKind, type: 'number' });
|
160
|
+
}
|
161
|
+
/** `Standard` Creates an integer type */
|
162
|
+
Integer(options = {}) {
|
163
|
+
return this.Store({ ...options, kind: exports.IntegerKind, type: 'integer' });
|
164
|
+
}
|
165
|
+
/** `Standard` Creates a boolean type */
|
166
|
+
Boolean(options = {}) {
|
167
|
+
return this.Store({ ...options, kind: exports.BooleanKind, type: 'boolean' });
|
168
|
+
}
|
169
|
+
/** `Standard` Creates a null type */
|
170
|
+
Null(options = {}) {
|
171
|
+
return this.Store({ ...options, kind: exports.NullKind, type: 'null' });
|
172
|
+
}
|
173
|
+
/** `Standard` Creates an unknown type */
|
174
|
+
Unknown(options = {}) {
|
175
|
+
return this.Store({ ...options, kind: exports.UnknownKind });
|
176
|
+
}
|
177
|
+
/** `Standard` Creates an any type */
|
178
|
+
Any(options = {}) {
|
179
|
+
return this.Store({ ...options, kind: exports.AnyKind });
|
180
|
+
}
|
181
|
+
/** `Standard` Creates a record type */
|
182
|
+
Record(key, value, options = {}) {
|
183
|
+
const pattern = (() => {
|
184
|
+
switch (key.kind) {
|
185
|
+
case exports.UnionKind: return `^${key.anyOf.map((literal) => literal.const).join('|')}$`;
|
186
|
+
case exports.KeyOfKind: return `^${key.enum.join('|')}$`;
|
187
|
+
case exports.NumberKind: return '^(0|[1-9][0-9]*)$';
|
188
|
+
case exports.StringKind: return key.pattern ? key.pattern : '^.*$';
|
189
|
+
default: throw Error('Invalid Record Key');
|
190
|
+
}
|
191
|
+
})();
|
192
|
+
return this.Store({ ...options, kind: exports.RecordKind, type: 'object', patternProperties: { [pattern]: value } });
|
193
|
+
}
|
194
|
+
/** `Standard` Creates a keyof type from the given object */
|
195
|
+
KeyOf(object, options = {}) {
|
196
|
+
const source = this.Deref(object);
|
197
|
+
const keys = Object.keys(source.properties);
|
198
|
+
return this.Store({ ...options, kind: exports.KeyOfKind, type: 'string', enum: keys });
|
199
|
+
}
|
200
|
+
/** `Standard` Makes all properties in the given object type required */
|
201
|
+
Required(object, options = {}) {
|
202
|
+
const source = this.Deref(object);
|
203
|
+
const schema = { ...clone(source), ...options };
|
204
|
+
schema.required = Object.keys(schema.properties);
|
205
|
+
for (const key of Object.keys(schema.properties)) {
|
206
|
+
const property = schema.properties[key];
|
207
|
+
switch (property.modifier) {
|
208
|
+
case exports.ReadonlyOptionalModifier:
|
209
|
+
property.modifier = exports.ReadonlyModifier;
|
210
|
+
break;
|
211
|
+
case exports.ReadonlyModifier:
|
212
|
+
property.modifier = exports.ReadonlyModifier;
|
213
|
+
break;
|
214
|
+
case exports.OptionalModifier:
|
215
|
+
delete property.modifier;
|
216
|
+
break;
|
217
|
+
default:
|
218
|
+
delete property.modifier;
|
219
|
+
break;
|
220
|
+
}
|
221
|
+
}
|
222
|
+
return this.Store(schema);
|
223
|
+
}
|
224
|
+
/** `Standard` Makes all properties in the given object type optional */
|
225
|
+
Partial(object, options = {}) {
|
226
|
+
const source = this.Deref(object);
|
227
|
+
const schema = { ...clone(source), ...options };
|
228
|
+
delete schema.required;
|
229
|
+
for (const key of Object.keys(schema.properties)) {
|
230
|
+
const property = schema.properties[key];
|
231
|
+
switch (property.modifier) {
|
232
|
+
case exports.ReadonlyOptionalModifier:
|
233
|
+
property.modifier = exports.ReadonlyOptionalModifier;
|
234
|
+
break;
|
235
|
+
case exports.ReadonlyModifier:
|
236
|
+
property.modifier = exports.ReadonlyOptionalModifier;
|
237
|
+
break;
|
238
|
+
case exports.OptionalModifier:
|
239
|
+
property.modifier = exports.OptionalModifier;
|
240
|
+
break;
|
241
|
+
default:
|
242
|
+
property.modifier = exports.OptionalModifier;
|
243
|
+
break;
|
244
|
+
}
|
245
|
+
}
|
246
|
+
return this.Store(schema);
|
247
|
+
}
|
248
|
+
/** `Standard` Picks property keys from the given object type */
|
249
|
+
Pick(object, keys, options = {}) {
|
250
|
+
const source = this.Deref(object);
|
251
|
+
const schema = { ...clone(source), ...options };
|
252
|
+
schema.required = schema.required ? schema.required.filter((key) => keys.includes(key)) : undefined;
|
253
|
+
for (const key of Object.keys(schema.properties)) {
|
254
|
+
if (!keys.includes(key))
|
255
|
+
delete schema.properties[key];
|
256
|
+
}
|
257
|
+
return this.Store(schema);
|
258
|
+
}
|
259
|
+
/** `Standard` Omits property keys from the given object type */
|
260
|
+
Omit(object, keys, options = {}) {
|
261
|
+
const source = this.Deref(object);
|
262
|
+
const schema = { ...clone(source), ...options };
|
263
|
+
schema.required = schema.required ? schema.required.filter((key) => !keys.includes(key)) : undefined;
|
264
|
+
for (const key of Object.keys(schema.properties)) {
|
265
|
+
if (keys.includes(key))
|
266
|
+
delete schema.properties[key];
|
267
|
+
}
|
268
|
+
return this.Store(schema);
|
269
|
+
}
|
270
|
+
/** `Standard` Omits the `kind` and `modifier` properties from the underlying schema */
|
271
|
+
Strict(schema, options = {}) {
|
272
|
+
return JSON.parse(JSON.stringify({ ...options, ...schema }));
|
273
|
+
}
|
274
|
+
/** `Extended` Creates a constructor type */
|
275
|
+
Constructor(args, returns, options = {}) {
|
276
|
+
return this.Store({ ...options, kind: exports.ConstructorKind, type: 'constructor', arguments: args, returns });
|
277
|
+
}
|
278
|
+
/** `Extended` Creates a function type */
|
279
|
+
Function(args, returns, options = {}) {
|
280
|
+
return this.Store({ ...options, kind: exports.FunctionKind, type: 'function', arguments: args, returns });
|
281
|
+
}
|
282
|
+
/** `Extended` Creates a promise type */
|
283
|
+
Promise(item, options = {}) {
|
284
|
+
return this.Store({ ...options, type: 'promise', kind: exports.PromiseKind, item });
|
285
|
+
}
|
286
|
+
/** `Extended` Creates a undefined type */
|
287
|
+
Undefined(options = {}) {
|
288
|
+
return this.Store({ ...options, type: 'undefined', kind: exports.UndefinedKind });
|
289
|
+
}
|
290
|
+
/** `Extended` Creates a void type */
|
291
|
+
Void(options = {}) {
|
292
|
+
return this.Store({ ...options, type: 'void', kind: exports.VoidKind });
|
293
|
+
}
|
294
|
+
/** `Standard` Creates a namespace for a set of related types */
|
295
|
+
Namespace($defs, options = {}) {
|
296
|
+
return this.Store({ ...options, kind: exports.NamespaceKind, $defs });
|
297
|
+
}
|
298
|
+
Ref(...args) {
|
299
|
+
if (args.length === 2) {
|
300
|
+
const namespace = args[0];
|
301
|
+
const targetKey = args[1];
|
302
|
+
if (namespace.$id === undefined)
|
303
|
+
throw new Error(`Referenced namespace has no $id`);
|
304
|
+
if (!this.schemas.has(namespace.$id))
|
305
|
+
throw new Error(`Unable to locate namespace with $id '${namespace.$id}'`);
|
306
|
+
return this.Store({ kind: exports.RefKind, $ref: `${namespace.$id}#/$defs/${targetKey}` });
|
307
|
+
}
|
308
|
+
else if (args.length === 1) {
|
309
|
+
const target = args[0];
|
310
|
+
if (target.$id === undefined)
|
311
|
+
throw new Error(`Referenced schema has no $id`);
|
312
|
+
if (!this.schemas.has(target.$id))
|
313
|
+
throw new Error(`Unable to locate schema with $id '${target.$id}'`);
|
314
|
+
return this.Store({ kind: exports.RefKind, $ref: target.$id });
|
315
|
+
}
|
316
|
+
else {
|
317
|
+
throw new Error('Type.Ref: Invalid arguments');
|
318
|
+
}
|
319
|
+
}
|
320
|
+
/** `Experimental` Creates a recursive type */
|
321
|
+
Rec(callback, options = {}) {
|
322
|
+
const $id = options.$id || '';
|
323
|
+
const self = callback({ $ref: `${$id}#/$defs/self` });
|
324
|
+
return this.Store({ ...options, $ref: `${$id}#/$defs/self`, $defs: { self } });
|
325
|
+
}
|
326
|
+
/** Conditionally stores and schema if it contains an $id and returns */
|
327
|
+
Store(schema) {
|
328
|
+
const $schema = schema;
|
329
|
+
if (!$schema['$id'])
|
330
|
+
return $schema;
|
331
|
+
this.schemas.set($schema['$id'], $schema);
|
332
|
+
return $schema;
|
333
|
+
}
|
334
|
+
/** Conditionally dereferences a schema if RefKind. Otherwise return argument */
|
335
|
+
Deref(schema) {
|
336
|
+
const $schema = schema;
|
337
|
+
if ($schema['kind'] !== exports.RefKind)
|
338
|
+
return schema;
|
339
|
+
if (!this.schemas.has($schema['$ref']))
|
340
|
+
throw Error(`Unable to locate schema with $id '${$schema['$ref']}'`);
|
341
|
+
return this.Deref(this.schemas.get($schema['$ref']));
|
342
|
+
}
|
343
|
+
}
|
344
|
+
exports.TypeBuilder = TypeBuilder;
|
345
|
+
exports.Type = new TypeBuilder();
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# Installation
|
2
|
+
> `npm install --save @types/node`
|
3
|
+
|
4
|
+
# Summary
|
5
|
+
This package contains type definitions for Node.js (https://nodejs.org/).
|
6
|
+
|
7
|
+
# Details
|
8
|
+
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node/v14.
|
9
|
+
|
10
|
+
### Additional Details
|
11
|
+
* Last updated: Wed, 26 Oct 2022 20:33:01 GMT
|
12
|
+
* Dependencies: none
|
13
|
+
* Global values: `AbortController`, `AbortSignal`, `Buffer`, `__dirname`, `__filename`, `clearImmediate`, `clearInterval`, `clearTimeout`, `console`, `exports`, `global`, `module`, `process`, `queueMicrotask`, `require`, `setImmediate`, `setInterval`, `setTimeout`
|
14
|
+
|
15
|
+
# Credits
|
16
|
+
These definitions were written by [Microsoft TypeScript](https://github.com/Microsoft), [DefinitelyTyped](https://github.com/DefinitelyTyped), [Alberto Schiabel](https://github.com/jkomyno), [Alvis HT Tang](https://github.com/alvis), [Andrew Makarov](https://github.com/r3nya), [Benjamin Toueg](https://github.com/btoueg), [Chigozirim C.](https://github.com/smac89), [David Junger](https://github.com/touffy), [Deividas Bakanas](https://github.com/DeividasBakanas), [Eugene Y. Q. Shen](https://github.com/eyqs), [Hannes Magnusson](https://github.com/Hannes-Magnusson-CK), [Hoàng Văn Khải](https://github.com/KSXGitHub), [Huw](https://github.com/hoo29), [Kelvin Jin](https://github.com/kjin), [Klaus Meinhardt](https://github.com/ajafff), [Lishude](https://github.com/islishude), [Mariusz Wiktorczyk](https://github.com/mwiktorczyk), [Mohsen Azimi](https://github.com/mohsen1), [Nicolas Even](https://github.com/n-e), [Nikita Galkin](https://github.com/galkin), [Parambir Singh](https://github.com/parambirs), [Sebastian Silbermann](https://github.com/eps1lon), [Seth Westphal](https://github.com/westy92), [Simon Schick](https://github.com/SimonSchick), [Thomas den Hollander](https://github.com/ThomasdenH), [Wilco Bakker](https://github.com/WilcoBakker), [wwwy3y3](https://github.com/wwwy3y3), [Samuel Ainsworth](https://github.com/samuela), [Kyle Uehlein](https://github.com/kuehlein), [Thanik Bhongbhibhat](https://github.com/bhongy), [Marcin Kopacz](https://github.com/chyzwar), [Trivikram Kamat](https://github.com/trivikr), [Junxiao Shi](https://github.com/yoursunny), [Ilia Baryshnikov](https://github.com/qwelias), [ExE Boss](https://github.com/ExE-Boss), [Piotr Błażejewicz](https://github.com/peterblazejewicz), [Anna Henningsen](https://github.com/addaleax), [Victor Perin](https://github.com/victorperin), [Yongsheng Zhang](https://github.com/ZYSzys), [Bond](https://github.com/bondz), and [Linus Unnebäck](https://github.com/LinusU).
|
@@ -0,0 +1,128 @@
|
|
1
|
+
declare module 'assert' {
|
2
|
+
/** An alias of `assert.ok()`. */
|
3
|
+
function assert(value: any, message?: string | Error): asserts value;
|
4
|
+
namespace assert {
|
5
|
+
class AssertionError extends Error {
|
6
|
+
actual: any;
|
7
|
+
expected: any;
|
8
|
+
operator: string;
|
9
|
+
generatedMessage: boolean;
|
10
|
+
code: 'ERR_ASSERTION';
|
11
|
+
|
12
|
+
constructor(options?: {
|
13
|
+
/** If provided, the error message is set to this value. */
|
14
|
+
message?: string | undefined;
|
15
|
+
/** The `actual` property on the error instance. */
|
16
|
+
actual?: any;
|
17
|
+
/** The `expected` property on the error instance. */
|
18
|
+
expected?: any;
|
19
|
+
/** The `operator` property on the error instance. */
|
20
|
+
operator?: string | undefined;
|
21
|
+
/** If provided, the generated stack trace omits frames before this function. */
|
22
|
+
// tslint:disable-next-line:ban-types
|
23
|
+
stackStartFn?: Function | undefined;
|
24
|
+
});
|
25
|
+
}
|
26
|
+
|
27
|
+
class CallTracker {
|
28
|
+
calls(exact?: number): () => void;
|
29
|
+
calls<Func extends (...args: any[]) => any>(fn?: Func, exact?: number): Func;
|
30
|
+
report(): CallTrackerReportInformation[];
|
31
|
+
verify(): void;
|
32
|
+
}
|
33
|
+
interface CallTrackerReportInformation {
|
34
|
+
message: string;
|
35
|
+
/** The actual number of times the function was called. */
|
36
|
+
actual: number;
|
37
|
+
/** The number of times the function was expected to be called. */
|
38
|
+
expected: number;
|
39
|
+
/** The name of the function that is wrapped. */
|
40
|
+
operator: string;
|
41
|
+
/** A stack trace of the function. */
|
42
|
+
stack: object;
|
43
|
+
}
|
44
|
+
|
45
|
+
type AssertPredicate = RegExp | (new () => object) | ((thrown: any) => boolean) | object | Error;
|
46
|
+
|
47
|
+
function fail(message?: string | Error): never;
|
48
|
+
/** @deprecated since v10.0.0 - use fail([message]) or other assert functions instead. */
|
49
|
+
function fail(
|
50
|
+
actual: any,
|
51
|
+
expected: any,
|
52
|
+
message?: string | Error,
|
53
|
+
operator?: string,
|
54
|
+
// tslint:disable-next-line:ban-types
|
55
|
+
stackStartFn?: Function,
|
56
|
+
): never;
|
57
|
+
function ok(value: any, message?: string | Error): asserts value;
|
58
|
+
/** @deprecated since v9.9.0 - use strictEqual() instead. */
|
59
|
+
function equal(actual: any, expected: any, message?: string | Error): void;
|
60
|
+
/** @deprecated since v9.9.0 - use notStrictEqual() instead. */
|
61
|
+
function notEqual(actual: any, expected: any, message?: string | Error): void;
|
62
|
+
/** @deprecated since v9.9.0 - use deepStrictEqual() instead. */
|
63
|
+
function deepEqual(actual: any, expected: any, message?: string | Error): void;
|
64
|
+
/** @deprecated since v9.9.0 - use notDeepStrictEqual() instead. */
|
65
|
+
function notDeepEqual(actual: any, expected: any, message?: string | Error): void;
|
66
|
+
function strictEqual<T>(actual: any, expected: T, message?: string | Error): asserts actual is T;
|
67
|
+
function notStrictEqual(actual: any, expected: any, message?: string | Error): void;
|
68
|
+
function deepStrictEqual<T>(actual: any, expected: T, message?: string | Error): asserts actual is T;
|
69
|
+
function notDeepStrictEqual(actual: any, expected: any, message?: string | Error): void;
|
70
|
+
|
71
|
+
function throws(block: () => any, message?: string | Error): void;
|
72
|
+
function throws(block: () => any, error: AssertPredicate, message?: string | Error): void;
|
73
|
+
function doesNotThrow(block: () => any, message?: string | Error): void;
|
74
|
+
function doesNotThrow(block: () => any, error: AssertPredicate, message?: string | Error): void;
|
75
|
+
|
76
|
+
function ifError(value: any): asserts value is null | undefined;
|
77
|
+
|
78
|
+
function rejects(block: (() => Promise<any>) | Promise<any>, message?: string | Error): Promise<void>;
|
79
|
+
function rejects(
|
80
|
+
block: (() => Promise<any>) | Promise<any>,
|
81
|
+
error: AssertPredicate,
|
82
|
+
message?: string | Error,
|
83
|
+
): Promise<void>;
|
84
|
+
function doesNotReject(block: (() => Promise<any>) | Promise<any>, message?: string | Error): Promise<void>;
|
85
|
+
function doesNotReject(
|
86
|
+
block: (() => Promise<any>) | Promise<any>,
|
87
|
+
error: AssertPredicate,
|
88
|
+
message?: string | Error,
|
89
|
+
): Promise<void>;
|
90
|
+
|
91
|
+
function match(value: string, regExp: RegExp, message?: string | Error): void;
|
92
|
+
function doesNotMatch(value: string, regExp: RegExp, message?: string | Error): void;
|
93
|
+
|
94
|
+
const strict: Omit<
|
95
|
+
typeof assert,
|
96
|
+
| 'equal'
|
97
|
+
| 'notEqual'
|
98
|
+
| 'deepEqual'
|
99
|
+
| 'notDeepEqual'
|
100
|
+
| 'ok'
|
101
|
+
| 'strictEqual'
|
102
|
+
| 'deepStrictEqual'
|
103
|
+
| 'ifError'
|
104
|
+
| 'strict'
|
105
|
+
> & {
|
106
|
+
(value: any, message?: string | Error): asserts value;
|
107
|
+
equal: typeof strictEqual;
|
108
|
+
notEqual: typeof notStrictEqual;
|
109
|
+
deepEqual: typeof deepStrictEqual;
|
110
|
+
notDeepEqual: typeof notDeepStrictEqual;
|
111
|
+
|
112
|
+
// Mapped types and assertion functions are incompatible?
|
113
|
+
// TS2775: Assertions require every name in the call target
|
114
|
+
// to be declared with an explicit type annotation.
|
115
|
+
ok: typeof ok;
|
116
|
+
strictEqual: typeof strictEqual;
|
117
|
+
deepStrictEqual: typeof deepStrictEqual;
|
118
|
+
ifError: typeof ifError;
|
119
|
+
strict: typeof strict;
|
120
|
+
};
|
121
|
+
}
|
122
|
+
|
123
|
+
export = assert;
|
124
|
+
}
|
125
|
+
declare module 'node:assert' {
|
126
|
+
import assert = require('assert');
|
127
|
+
export = assert;
|
128
|
+
}
|