@tstdl/base 0.81.34 → 0.82.0
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/api/client/client.d.ts +3 -3
- package/api/default-error-handlers.d.ts +1 -1
- package/api/response.d.ts +8 -8
- package/api/server/api-controller.d.ts +1 -1
- package/api/server/gateway.d.ts +9 -9
- package/api/server/middlewares/cors.middleware.d.ts +1 -1
- package/api/server/module.d.ts +1 -1
- package/api/types.d.ts +30 -30
- package/api/utils.d.ts +1 -1
- package/authentication/authentication-credentials.service.d.ts +6 -0
- package/authentication/authentication-credentials.service.js +17 -0
- package/authentication/authentication-credentials.service.js.map +1 -0
- package/authentication/authentication-session.service.d.ts +6 -0
- package/authentication/authentication-session.service.js +17 -0
- package/authentication/authentication-session.service.js.map +1 -0
- package/authentication/authentication-token-payload.provider.d.ts +3 -0
- package/authentication/authentication-token-payload.provider.js +17 -0
- package/authentication/authentication-token-payload.provider.js.map +1 -0
- package/authentication/authentication.service.d.ts +42 -0
- package/authentication/authentication.service.js +133 -0
- package/authentication/authentication.service.js.map +1 -0
- package/authentication/models/authentication-credentials.model.d.ts +6 -0
- package/authentication/models/authentication-credentials.model.js +37 -0
- package/authentication/models/authentication-credentials.model.js.map +1 -0
- package/authentication/models/authentication-session.model.d.ts +9 -0
- package/authentication/models/authentication-session.model.js +52 -0
- package/authentication/models/authentication-session.model.js.map +1 -0
- package/authentication/models/index.d.ts +2 -0
- package/authentication/models/index.js +19 -0
- package/authentication/models/index.js.map +1 -0
- package/authentication/tokens.d.ts +2 -0
- package/authentication/tokens.js +6 -0
- package/authentication/tokens.js.map +1 -0
- package/collections/keyed-set.d.ts +1 -1
- package/collections/observable/observable-collection.d.ts +1 -1
- package/collections/observable/observable-list.d.ts +2 -2
- package/container/container.d.ts +3 -3
- package/container/decorators.d.ts +3 -3
- package/container/interfaces.d.ts +1 -1
- package/container/provider.d.ts +6 -6
- package/container/resolve-chain.d.ts +2 -2
- package/container/token.d.ts +3 -3
- package/container/type-info.d.ts +1 -1
- package/container/types.d.ts +4 -4
- package/core.d.ts +1 -1
- package/data-structures/linked-list.d.ts +1 -1
- package/data-structures/multi-key-map.d.ts +2 -2
- package/data-structures/sorted-array-list.d.ts +1 -1
- package/database/entity-repository.d.ts +2 -2
- package/database/entity.d.ts +3 -3
- package/database/module.d.ts +1 -1
- package/database/mongo/classes.d.ts +3 -3
- package/database/mongo/model/document.d.ts +3 -3
- package/database/mongo/module.d.ts +1 -1
- package/database/mongo/mongo-base.repository.d.ts +11 -11
- package/database/mongo/mongo-bulk.d.ts +1 -1
- package/database/mongo/mongo-entity-repository.d.ts +7 -7
- package/database/mongo/types.d.ts +16 -16
- package/database/query.d.ts +38 -38
- package/disposable/async-disposer.d.ts +3 -3
- package/distributed-loop/distributed-loop.d.ts +2 -2
- package/error/custom.error.d.ts +1 -1
- package/http/client/adapters/undici-http-client.adapter.d.ts +1 -1
- package/http/client/http-client-request.d.ts +5 -5
- package/http/client/http-client-response.d.ts +2 -2
- package/http/client/http-client.d.ts +5 -5
- package/http/http-body.d.ts +3 -1
- package/http/http-body.js +18 -12
- package/http/http-body.js.map +1 -1
- package/http/http-form.d.ts +2 -2
- package/http/http-headers.d.ts +3 -3
- package/http/http-query.d.ts +2 -2
- package/http/http-url-parameters.d.ts +2 -2
- package/http/http-value-map.d.ts +1 -1
- package/http/server/http-server-request.d.ts +1 -1
- package/http/server/http-server-response.d.ts +1 -1
- package/http/server/http-server.d.ts +1 -1
- package/http/server/node/node-http-server.d.ts +1 -1
- package/http/types.d.ts +5 -5
- package/http/utils.d.ts +3 -3
- package/image-service/imgproxy/imgproxy-image-service.d.ts +1 -1
- package/json-path/json-path.d.ts +4 -4
- package/key-value-store/key-value.store.d.ts +1 -1
- package/key-value-store/mongo/module.d.ts +1 -1
- package/key-value-store/mongo/mongo-key-value.model.d.ts +1 -1
- package/lock/lock.d.ts +4 -4
- package/lock/mongo/model.d.ts +1 -1
- package/lock/mongo/module.d.ts +1 -1
- package/lock/provider.d.ts +1 -1
- package/logger/logger.d.ts +6 -6
- package/mail/mail.client.d.ts +1 -1
- package/mail/models/mail-address.model.d.ts +1 -1
- package/mail/models/mail-content.model.d.ts +1 -1
- package/mail/models/mail-data.model.d.ts +1 -1
- package/mail/models/mail-log.model.d.ts +2 -2
- package/mail/models/mail-send-result.model.d.ts +1 -1
- package/mail/models/mail-template.model.d.ts +1 -1
- package/mail/module.d.ts +1 -1
- package/mail/repositories/mongo-mail-log.repository.d.ts +2 -2
- package/message-bus/local/types.d.ts +1 -1
- package/message-bus/message-bus.d.ts +1 -1
- package/migration/migration-state.d.ts +2 -2
- package/migration/migrator.d.ts +4 -4
- package/migration/mongo/module.d.ts +1 -1
- package/module/module-metric-reporter.d.ts +2 -2
- package/module/module.d.ts +1 -1
- package/module/modules/function.module.d.ts +1 -1
- package/module/modules/web-server.module.d.ts +1 -1
- package/notification/api.d.ts +1 -1
- package/notification/module.d.ts +1 -1
- package/object-storage/object-storage.d.ts +2 -2
- package/object-storage/object.d.ts +1 -1
- package/object-storage/s3/s3.object-storage-provider.d.ts +1 -1
- package/openid-connect/mongo-oidc-state.repository.d.ts +1 -1
- package/openid-connect/oidc-configuration.service.d.ts +1 -1
- package/openid-connect/oidc-state.model.d.ts +2 -2
- package/openid-connect/oidc.service-model.d.ts +8 -8
- package/orm/types.d.ts +4 -4
- package/package.json +4 -4
- package/pdf/pdf.service.d.ts +3 -3
- package/pool/pool.d.ts +4 -4
- package/promise/cancelable-promise.d.ts +1 -1
- package/promise/lazy-promise.d.ts +1 -1
- package/queue/mongo/job.d.ts +2 -2
- package/queue/mongo/queue.js +2 -2
- package/queue/mongo/queue.js.map +1 -1
- package/queue/queue.d.ts +11 -6
- package/queue/queue.js +2 -1
- package/queue/queue.js.map +1 -1
- package/reflection/registry.d.ts +9 -9
- package/reflection/types.d.ts +32 -32
- package/reflection/utils.d.ts +5 -5
- package/rpc/endpoints/message-port.rpc-endpoint.d.ts +3 -3
- package/rpc/model.d.ts +22 -22
- package/rpc/rpc.d.ts +1 -1
- package/rxjs/intersection-observer.d.ts +1 -1
- package/rxjs/mutation-observer.d.ts +1 -1
- package/rxjs/performance-observer.d.ts +1 -1
- package/rxjs/resize-observer.d.ts +1 -1
- package/rxjs/slow-array.d.ts +1 -1
- package/rxjs/touch.d.ts +1 -1
- package/schema/constraints/generic.d.ts +2 -2
- package/schema/constraints/length.d.ts +1 -1
- package/schema/decorators/types.d.ts +3 -3
- package/schema/schema.d.ts +4 -4
- package/schema/schema.error.d.ts +1 -1
- package/schema/schema.js +10 -13
- package/schema/schema.js.map +1 -1
- package/schema/schemas/any.d.ts +1 -1
- package/schema/schemas/array.d.ts +1 -1
- package/schema/schemas/assign.d.ts +2 -0
- package/schema/schemas/assign.js.map +1 -1
- package/schema/schemas/boolean.d.ts +1 -1
- package/schema/schemas/date.d.ts +1 -1
- package/schema/schemas/enumeration.d.ts +1 -1
- package/schema/schemas/instance.d.ts +1 -1
- package/schema/schemas/literal.d.ts +1 -1
- package/schema/schemas/nullable.d.ts +1 -1
- package/schema/schemas/number.d.ts +1 -1
- package/schema/schemas/object.d.ts +1 -1
- package/schema/schemas/one-or-many.d.ts +2 -2
- package/schema/schemas/optional.d.ts +1 -1
- package/schema/schemas/readable-stream.d.ts +1 -1
- package/schema/schemas/record.d.ts +1 -1
- package/schema/schemas/regexp.d.ts +1 -1
- package/schema/schemas/string.d.ts +1 -1
- package/schema/schemas/uint8-array.d.ts +1 -1
- package/schema/schemas/union.d.ts +1 -1
- package/schema/schemas/unknown.d.ts +1 -1
- package/schema/transformers/generic.d.ts +1 -1
- package/schema/types.d.ts +31 -31
- package/schema/utils/schema.js.map +1 -1
- package/search-index/elastic/config.d.ts +1 -1
- package/search-index/elastic/model/elastic-query.d.ts +15 -15
- package/search-index/elastic/model/index-mapping.d.ts +14 -14
- package/search-index/elastic/model/sort.d.ts +3 -3
- package/search-index/elastic/module.d.ts +1 -1
- package/search-index/search-index.d.ts +1 -1
- package/search-index/search-result.d.ts +2 -2
- package/serializer/handlers/error.d.ts +1 -1
- package/serializer/handlers/map.d.ts +1 -1
- package/serializer/handlers/regex.d.ts +1 -1
- package/serializer/handlers/set.d.ts +1 -1
- package/serializer/serializable.d.ts +6 -6
- package/serializer/serializer.d.ts +1 -1
- package/serializer/types.d.ts +15 -15
- package/sse/server-sent-events.d.ts +3 -3
- package/tailwind/theme-adapter.d.ts +1 -1
- package/templates/module.d.ts +1 -1
- package/templates/providers/file.provider-template.d.ts +2 -2
- package/templates/providers/file.provider-template.js +2 -1
- package/templates/providers/file.provider-template.js.map +1 -1
- package/templates/renderers/handlebars.template-renderer.d.ts +9 -9
- package/templates/renderers/mjml.template-renderer.d.ts +3 -3
- package/templates/renderers/string.template-renderer.d.ts +1 -1
- package/templates/resolvers/file.template-resolver.d.ts +2 -2
- package/templates/template.model.d.ts +1 -1
- package/templates/template.renderer.d.ts +4 -4
- package/templates/template.service.d.ts +1 -1
- package/text/dynamic-text.model.d.ts +1 -1
- package/text/localizable-text.model.d.ts +1 -1
- package/text/localization.service.d.ts +11 -11
- package/theme/theme-service.d.ts +6 -6
- package/threading/thread-pool.d.ts +1 -1
- package/threading/thread-worker.d.ts +1 -1
- package/types/geo-json.d.ts +12 -12
- package/types.d.ts +91 -91
- package/utils/any-iterable-iterator.d.ts +3 -3
- package/utils/async-iterable-helpers/parallel/types.d.ts +2 -2
- package/utils/async-iterable-helpers/types.d.ts +7 -7
- package/utils/backoff.d.ts +5 -5
- package/utils/benchmark.d.ts +1 -1
- package/utils/binary-search.d.ts +1 -1
- package/utils/binary.js.map +1 -1
- package/utils/cancellation-token.d.ts +1 -1
- package/utils/compression.d.ts +1 -1
- package/utils/cryptography.d.ts +11 -11
- package/utils/date-time.d.ts +8 -7
- package/utils/date-time.js +6 -2
- package/utils/date-time.js.map +1 -1
- package/utils/equals.d.ts +3 -3
- package/utils/factory-map.d.ts +1 -1
- package/utils/format-error.d.ts +1 -1
- package/utils/function/memoize.d.ts +1 -1
- package/utils/helpers.d.ts +1 -1
- package/utils/iterable-helpers/types.d.ts +6 -6
- package/utils/jwt.d.ts +4 -4
- package/utils/math.d.ts +1 -1
- package/utils/merge.d.ts +1 -1
- package/utils/middleware.d.ts +9 -9
- package/utils/moving-metric.d.ts +1 -1
- package/utils/object/decycle.d.ts +1 -1
- package/utils/object/dereference.d.ts +1 -1
- package/utils/object/forward-ref.d.ts +2 -2
- package/utils/object/lazy-property.d.ts +5 -5
- package/utils/object/merge.d.ts +1 -1
- package/utils/object/property-name.d.ts +5 -5
- package/utils/patch-worker.d.ts +1 -1
- package/utils/periodic-sampler.d.ts +1 -1
- package/utils/provider-function-iterable.d.ts +2 -2
- package/utils/proxy.d.ts +1 -1
- package/utils/singleton.d.ts +2 -2
- package/utils/sort.d.ts +2 -2
- package/utils/stream/stream-helper-types.d.ts +5 -5
- package/utils/type-guards.d.ts +3 -3
- package/utils/url-builder.d.ts +4 -4
- package/web-types.d.ts +4 -4
|
@@ -2,10 +2,10 @@ import type { Injectable } from "../../container";
|
|
|
2
2
|
import { resolveArgumentType } from "../../container";
|
|
3
3
|
import { Template } from '../template.model';
|
|
4
4
|
import { TemplateProvider } from '../template.provider';
|
|
5
|
-
export
|
|
5
|
+
export type FileTemplateProviderConfig = {
|
|
6
6
|
basePath?: string;
|
|
7
7
|
};
|
|
8
|
-
export
|
|
8
|
+
export type FileTemplateProviderArgument = string;
|
|
9
9
|
export declare const fileTemplateProviderConfig: FileTemplateProviderConfig;
|
|
10
10
|
export declare class FileTemplateProvider extends TemplateProvider implements Injectable<FileTemplateProviderArgument> {
|
|
11
11
|
private readonly basePath;
|
|
@@ -29,6 +29,7 @@ let FileTemplateProvider = class FileTemplateProvider extends template_provider_
|
|
|
29
29
|
this.basePath = path.resolve(basePath);
|
|
30
30
|
}
|
|
31
31
|
async get(key) {
|
|
32
|
+
var _a;
|
|
32
33
|
if (!keyPattern.test(key)) {
|
|
33
34
|
throw new bad_request_error_1.BadRequestError('Illegal template key. Only a-z, A-Z, 0-9, _ and - are allowed.');
|
|
34
35
|
}
|
|
@@ -36,7 +37,7 @@ let FileTemplateProvider = class FileTemplateProvider extends template_provider_
|
|
|
36
37
|
if (!filePath.startsWith(this.basePath)) {
|
|
37
38
|
throw new bad_request_error_1.BadRequestError(`Illegal file path. Must be inside "${this.basePath}".`);
|
|
38
39
|
}
|
|
39
|
-
const templateModule = await Promise.resolve().then(() => require(
|
|
40
|
+
const templateModule = await (_a = filePath, Promise.resolve().then(() => require(_a)));
|
|
40
41
|
const fileContent = templateModule.default;
|
|
41
42
|
return schema_1.Schema.parse(template_model_1.Template, fileContent);
|
|
42
43
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file.provider-template.js","sourceRoot":"","sources":["../../../source/templates/providers/file.provider-template.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,+CAAwE;AACxE,qEAA4D;AAC5D,yCAAkC;AAClC,6BAA6B;AAC7B,sDAA6C;AAC7C,4DAAwD;AAQ3C,QAAA,0BAA0B,GAA+B,EAAE,CAAC;AAEzE,MAAM,UAAU,GAAG,aAAa,CAAC;AAK1B,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,oCAAgB;IACvC,QAAQ,CAAS;IAEzB,CAAC,+BAAmB,CAAC,CAA+B;IAC7D,YAAyB,QAAgB;QACvC,KAAK,EAAE,CAAC;QAER,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACzC,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,GAAW
|
|
1
|
+
{"version":3,"file":"file.provider-template.js","sourceRoot":"","sources":["../../../source/templates/providers/file.provider-template.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,+CAAwE;AACxE,qEAA4D;AAC5D,yCAAkC;AAClC,6BAA6B;AAC7B,sDAA6C;AAC7C,4DAAwD;AAQ3C,QAAA,0BAA0B,GAA+B,EAAE,CAAC;AAEzE,MAAM,UAAU,GAAG,aAAa,CAAC;AAK1B,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,oCAAgB;IACvC,QAAQ,CAAS;IAEzB,CAAC,+BAAmB,CAAC,CAA+B;IAC7D,YAAyB,QAAgB;QACvC,KAAK,EAAE,CAAC;QAER,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACzC,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,GAAW;;QACnB,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;YACzB,MAAM,IAAI,mCAAe,CAAC,gEAAgE,CAAC,CAAC;SAC7F;QAED,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,GAAG,KAAK,CAAC,CAAC;QAE1D,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE;YACvC,MAAM,IAAI,mCAAe,CAAC,sCAAsC,IAAI,CAAC,QAAQ,IAAI,CAAC,CAAC;SACpF;QAED,MAAM,cAAc,GAAG,YAAa,QAAQ,4CAAyB,CAAC;QACtE,MAAM,WAAW,GAAG,cAAc,CAAC,OAAO,CAAC;QAC3C,OAAO,eAAM,CAAC,KAAK,CAAC,yBAAQ,EAAE,WAAW,CAAC,CAAC;IAC7C,CAAC;CACF,CAAA;AAzBY,oBAAoB;IAHhC,IAAA,qBAAS,EAAC;QACT,uBAAuB,EAAE,GAAG,EAAE,CAAC,kCAA0B,CAAC,QAAQ;KACnE,CAAC;IAKa,WAAA,IAAA,qBAAS,GAAE,CAAA;;GAJb,oBAAoB,CAyBhC;AAzBY,oDAAoB;AA2BjC,SAAgB,6BAA6B,CAAC,SAA8C,EAAE;IAC5F,kCAA0B,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,IAAI,kCAA0B,CAAC,QAAQ,CAAC;AAC/F,CAAC;AAFD,sEAEC"}
|
|
@@ -4,15 +4,15 @@ import { TemplateResolverProvider } from '../template-resolver.provider';
|
|
|
4
4
|
import type { TemplateField } from '../template.model';
|
|
5
5
|
import type { TemplateRenderObject } from '../template.renderer';
|
|
6
6
|
import { TemplateRenderer } from '../template.renderer';
|
|
7
|
-
export
|
|
7
|
+
export type HandlebarsTemplateHelperOptionsLocationItem = {
|
|
8
8
|
line: number;
|
|
9
9
|
column: number;
|
|
10
10
|
};
|
|
11
|
-
export
|
|
11
|
+
export type HandlebarsTemplateHelperOptionsLocation = {
|
|
12
12
|
start: HandlebarsTemplateHelperOptionsLocationItem;
|
|
13
13
|
end: HandlebarsTemplateHelperOptionsLocationItem;
|
|
14
14
|
};
|
|
15
|
-
export
|
|
15
|
+
export type HandlebarsTemplateHelperOptions = {
|
|
16
16
|
name: string;
|
|
17
17
|
location?: HandlebarsTemplateHelperOptionsLocation;
|
|
18
18
|
data?: Record<string>;
|
|
@@ -21,17 +21,17 @@ export declare type HandlebarsTemplateHelperOptions = {
|
|
|
21
21
|
fn?: handlebars.TemplateDelegate;
|
|
22
22
|
inverse?: handlebars.TemplateDelegate;
|
|
23
23
|
};
|
|
24
|
-
export
|
|
25
|
-
export
|
|
26
|
-
export
|
|
27
|
-
export
|
|
28
|
-
export
|
|
24
|
+
export type HandlebarsTemplateHelper = (context: unknown, args: unknown[], options: HandlebarsTemplateHelperOptions) => any;
|
|
25
|
+
export type HandlebarsTemplateHelpersObject = Record<string, HandlebarsTemplateHelper>;
|
|
26
|
+
export type HandlebarsTemplatePartial = string | TemplateField<string, 'handlebars', HandlebarsRendererOptions> | handlebars.TemplateDelegate;
|
|
27
|
+
export type HandlebarsTemplatePartialsObject = Record<string, HandlebarsTemplatePartial>;
|
|
28
|
+
export type HandlebarsRendererOptions = {
|
|
29
29
|
strict?: boolean;
|
|
30
30
|
preventIndent?: boolean;
|
|
31
31
|
helpers?: HandlebarsTemplateHelpersObject;
|
|
32
32
|
partials?: HandlebarsTemplatePartialsObject;
|
|
33
33
|
};
|
|
34
|
-
export
|
|
34
|
+
export type HandlebarsTemplateRenderObject = TemplateRenderObject<'handlebars', HandlebarsRendererOptions>;
|
|
35
35
|
export declare class HandlebarsTemplateRenderer extends TemplateRenderer<'handlebars', HandlebarsRendererOptions> {
|
|
36
36
|
private readonly templateResolverProvider;
|
|
37
37
|
private readonly compileHandlebarsTemplate;
|
|
@@ -2,11 +2,11 @@ import type { MJMLParsingOptions } from 'mjml-core';
|
|
|
2
2
|
import { TemplateRendererProvider } from '../template-renderer.provider';
|
|
3
3
|
import type { TemplateRenderObject, TemplateRenderResult } from '../template.renderer';
|
|
4
4
|
import { TemplateRenderer } from '../template.renderer';
|
|
5
|
-
export
|
|
5
|
+
export type MjmlRendererOptions = Pick<MJMLParsingOptions, 'fonts' | 'keepComments' | 'validationLevel'> & {
|
|
6
6
|
preprocessorOptions?: any;
|
|
7
7
|
};
|
|
8
|
-
export
|
|
9
|
-
export
|
|
8
|
+
export type MjmlRendererString = 'mjml' | `mjml-${string}`;
|
|
9
|
+
export type MjmlTemplateRenderObject = TemplateRenderObject<MjmlRendererString, MjmlRendererOptions>;
|
|
10
10
|
export declare class MjmlTemplateRenderer extends TemplateRenderer<MjmlRendererString, MjmlRendererOptions> {
|
|
11
11
|
private readonly rendererProvider;
|
|
12
12
|
constructor(rendererProvider: TemplateRendererProvider);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { TemplateRenderObject, TemplateRenderResult } from '../template.renderer';
|
|
2
2
|
import { TemplateRenderer } from '../template.renderer';
|
|
3
|
-
export
|
|
3
|
+
export type StringTemplateRenderObject = TemplateRenderObject<'string', undefined>;
|
|
4
4
|
export declare class StringTemplateRenderer extends TemplateRenderer<'string', undefined> {
|
|
5
5
|
constructor();
|
|
6
6
|
canHandleType(type: string): boolean;
|
|
@@ -4,10 +4,10 @@ import { TypedOmit } from "../../types";
|
|
|
4
4
|
import { TemplateField } from '../template.model';
|
|
5
5
|
import { TemplateRenderer, TemplateRendererOptions, TemplateRendererString } from '../template.renderer';
|
|
6
6
|
import { TemplateResolver } from '../template.resolver';
|
|
7
|
-
export
|
|
7
|
+
export type FileTemplateProviderConfig = {
|
|
8
8
|
basePath?: string;
|
|
9
9
|
};
|
|
10
|
-
export
|
|
10
|
+
export type FileTemplateProviderArgument = string;
|
|
11
11
|
export declare const fileTemplateProviderConfig: FileTemplateProviderConfig;
|
|
12
12
|
export declare class FileTemplateField<Renderer extends string = string, Options = any> extends TemplateField<'file', Renderer, Options> {
|
|
13
13
|
templateFile: string;
|
|
@@ -4,7 +4,7 @@ export declare class TemplateField<Resolver extends string = string, Renderer ex
|
|
|
4
4
|
renderer: Renderer;
|
|
5
5
|
options?: Options;
|
|
6
6
|
}
|
|
7
|
-
export
|
|
7
|
+
export type TemplateFields<Fields extends Record<string, boolean>, Resolver extends string = string, Renderer extends string = string, Options = any> = SimplifyObject<{
|
|
8
8
|
[P in keyof PickBy<Fields, true>]: TemplateField<Resolver, Renderer, Options>;
|
|
9
9
|
} & {
|
|
10
10
|
[P in keyof PickBy<Fields, false>]?: TemplateField<Resolver, Renderer, Options>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export type TemplateRenderResult = string;
|
|
2
|
+
export type TemplateRenderObject<Renderer extends string = string, Options = any> = {
|
|
3
3
|
renderer: Renderer;
|
|
4
4
|
template: string;
|
|
5
5
|
options?: Options;
|
|
6
6
|
};
|
|
7
|
-
export
|
|
8
|
-
export
|
|
7
|
+
export type TemplateRendererString = typeof templateRendererString;
|
|
8
|
+
export type TemplateRendererOptions = typeof templateRendererOptions;
|
|
9
9
|
export declare const templateRendererString: unique symbol;
|
|
10
10
|
export declare const templateRendererOptions: unique symbol;
|
|
11
11
|
export declare abstract class TemplateRenderer<Renderer extends string = string, Options = any> {
|
|
@@ -3,7 +3,7 @@ import { TemplateRendererProvider } from './template-renderer.provider';
|
|
|
3
3
|
import { TemplateResolverProvider } from './template-resolver.provider';
|
|
4
4
|
import type { Template } from './template.model';
|
|
5
5
|
import { TemplateProvider } from './template.provider';
|
|
6
|
-
export
|
|
6
|
+
export type TemplateServiceRenderResult<T extends Template = Template> = {
|
|
7
7
|
fields: Record<keyof T['fields'], string>;
|
|
8
8
|
options: T['options'];
|
|
9
9
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Observable } from 'rxjs';
|
|
2
2
|
import type { LocalizableText } from './localizable-text.model';
|
|
3
3
|
import { LocalizationService } from './localization.service';
|
|
4
|
-
export
|
|
4
|
+
export type DynamicText = LocalizableText | Observable<LocalizableText>;
|
|
5
5
|
export declare function resolveDynamicText$(text: DynamicText, localizationService?: LocalizationService): Observable<string>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { LocalizationData } from './localization.service';
|
|
2
|
-
export
|
|
2
|
+
export type LocalizableText = string | LocalizationData;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import type { Enumeration, EnumerationValue } from "../types";
|
|
2
2
|
import type { PropertyName } from "../utils/object/property-name";
|
|
3
3
|
import type { Observable } from 'rxjs';
|
|
4
|
-
export
|
|
4
|
+
export type Language = {
|
|
5
5
|
code: string;
|
|
6
6
|
name: string;
|
|
7
7
|
};
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
|
|
8
|
+
export type LocalizeFunction<Parameters = void> = (parameters: Parameters) => string;
|
|
9
|
+
export type LocalizeItem<Parameters = void> = string | LocalizeFunction<Parameters>;
|
|
10
|
+
type LocalizationTemplate = {
|
|
11
11
|
[key: string]: LocalizeItem<any> | LocalizationTemplate;
|
|
12
12
|
};
|
|
13
|
-
export
|
|
13
|
+
export type EnumerationLocalization<T extends Enumeration = Enumeration> = {
|
|
14
14
|
[P in EnumerationValue<T>]: LocalizeItem<any>;
|
|
15
15
|
};
|
|
16
|
-
export
|
|
17
|
-
export
|
|
16
|
+
export type EnumerationLocalizationEntry<T extends Enumeration = Enumeration> = [T, EnumerationLocalization<T>];
|
|
17
|
+
export type Localization<T extends LocalizationTemplate = LocalizationTemplate, Enums extends Enumeration[] = []> = {
|
|
18
18
|
language: Language;
|
|
19
19
|
keys: T;
|
|
20
20
|
enums: {
|
|
@@ -22,18 +22,18 @@ export declare type Localization<T extends LocalizationTemplate = LocalizationTe
|
|
|
22
22
|
};
|
|
23
23
|
};
|
|
24
24
|
declare const parametersSymbol: unique symbol;
|
|
25
|
-
export
|
|
25
|
+
export type LocalizationKey<Parameters = void> = PropertyName & {
|
|
26
26
|
[parametersSymbol]: Parameters;
|
|
27
27
|
};
|
|
28
|
-
export
|
|
28
|
+
export type LocalizationData<Parameters = any> = LocalizationKey | LocalizationDataObject<Parameters> | {
|
|
29
29
|
key: LocalizationKey;
|
|
30
30
|
parameters?: void;
|
|
31
31
|
};
|
|
32
|
-
export
|
|
32
|
+
export type LocalizationDataObject<Parameters> = {
|
|
33
33
|
key: LocalizationKey<Parameters>;
|
|
34
34
|
parameters: Parameters;
|
|
35
35
|
};
|
|
36
|
-
export
|
|
36
|
+
export type LocalizationKeys<T extends LocalizationTemplate> = {
|
|
37
37
|
[P in keyof T]: T[P] extends LocalizationTemplate ? LocalizationKeys<T[P]> : T[P] extends LocalizeItem<infer R> ? LocalizationKey<R> : LocalizationKey;
|
|
38
38
|
};
|
|
39
39
|
export declare function isLocalizationKey(value: any): value is LocalizationKey;
|
package/theme/theme-service.d.ts
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
import type { UnionToTuple } from "../types";
|
|
2
2
|
import type { Observable } from 'rxjs';
|
|
3
|
-
export
|
|
3
|
+
export type CalculatedPalette<Colors extends string = string> = {
|
|
4
4
|
[Color in Colors]: {
|
|
5
5
|
main: ColorTones;
|
|
6
6
|
text: ColorTones;
|
|
7
7
|
border?: ColorTones;
|
|
8
8
|
};
|
|
9
9
|
};
|
|
10
|
-
export
|
|
10
|
+
export type CalculatedTheme<Colors extends string = string> = {
|
|
11
11
|
name: string;
|
|
12
12
|
palette: CalculatedPalette<Colors>;
|
|
13
13
|
};
|
|
14
|
-
export
|
|
14
|
+
export type PaletteColor = string | {
|
|
15
15
|
main: string;
|
|
16
16
|
text?: string;
|
|
17
17
|
border?: string;
|
|
18
18
|
};
|
|
19
|
-
export
|
|
19
|
+
export type Theme<Colors extends string = string> = {
|
|
20
20
|
name: string;
|
|
21
21
|
textColors?: string[];
|
|
22
22
|
palette: Palette<Colors>;
|
|
23
23
|
};
|
|
24
|
-
export
|
|
24
|
+
export type Palette<Colors extends string = string> = {
|
|
25
25
|
[Color in Colors]: PaletteColor;
|
|
26
26
|
};
|
|
27
|
-
export
|
|
27
|
+
export type ColorTones = {
|
|
28
28
|
base: string;
|
|
29
29
|
50: string;
|
|
30
30
|
100: string;
|
|
@@ -4,7 +4,7 @@ import { disposeAsync } from "../disposable";
|
|
|
4
4
|
import type { Logger } from "../logger";
|
|
5
5
|
import type * as NodeWorkerThreads from 'worker_threads';
|
|
6
6
|
import type { ThreadWorker } from './thread-worker';
|
|
7
|
-
export
|
|
7
|
+
export type ThreadOptions = (WorkerOptions | NodeWorkerThreads.WorkerOptions) & {
|
|
8
8
|
threadCount?: number;
|
|
9
9
|
};
|
|
10
10
|
export declare class ThreadPool implements AsyncDisposable {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { RpcEndpointSource } from "../rpc";
|
|
2
|
-
export
|
|
2
|
+
export type ThreadWorker = (...args: any[]) => any | Promise<any>;
|
|
3
3
|
export declare function exposeThreadWorker<T extends ThreadWorker>(worker: T, endpointOrSource: RpcEndpointSource, name?: string): void;
|
package/types/geo-json.d.ts
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
import type { JsonObject } from "../types";
|
|
2
|
-
export
|
|
3
|
-
export
|
|
2
|
+
export type Position = [longitude: number, latitude: number, elevation?: number];
|
|
3
|
+
export type GeoJsonObject<Type extends string> = {
|
|
4
4
|
type: Type;
|
|
5
5
|
bbox?: [number, number, number, number] | [number, number, number, number, number, number];
|
|
6
6
|
};
|
|
7
|
-
export
|
|
7
|
+
export type Point = GeoJsonObject<'Point'> & {
|
|
8
8
|
coordinates: Position;
|
|
9
9
|
};
|
|
10
|
-
export
|
|
10
|
+
export type LineString = GeoJsonObject<'LineString'> & {
|
|
11
11
|
coordinates: Position[];
|
|
12
12
|
};
|
|
13
|
-
export
|
|
13
|
+
export type Polygon = GeoJsonObject<'Polygon'> & {
|
|
14
14
|
coordinates: Position[][];
|
|
15
15
|
};
|
|
16
|
-
export
|
|
16
|
+
export type MultiPoint = GeoJsonObject<'MultiPoint'> & {
|
|
17
17
|
coordinates: Position[];
|
|
18
18
|
};
|
|
19
|
-
export
|
|
19
|
+
export type MultiLineString = GeoJsonObject<'MultiLineString'> & {
|
|
20
20
|
coordinates: Position[][];
|
|
21
21
|
};
|
|
22
|
-
export
|
|
22
|
+
export type MultiPolygon = GeoJsonObject<'MultiPolygon'> & {
|
|
23
23
|
coordinates: Position[][][];
|
|
24
24
|
};
|
|
25
|
-
export
|
|
25
|
+
export type GeometryCollection = GeoJsonObject<'GeometryCollection'> & {
|
|
26
26
|
geometries: Geometry[];
|
|
27
27
|
};
|
|
28
|
-
export
|
|
29
|
-
export
|
|
28
|
+
export type Geometry = Point | LineString | Polygon | MultiPoint | MultiLineString | MultiPolygon | GeometryCollection;
|
|
29
|
+
export type Feature<G extends Geometry | null = null, P extends JsonObject | null = null> = GeoJsonObject<'Feature'> & {
|
|
30
30
|
id?: string | number;
|
|
31
31
|
geometry: G;
|
|
32
32
|
properties: P;
|
|
33
33
|
};
|
|
34
|
-
export
|
|
34
|
+
export type FeatureCollection<G extends Geometry | null = null, P extends JsonObject | null = null> = GeoJsonObject<'FeatureCollection'> & {
|
|
35
35
|
features: Feature<G, P>[];
|
|
36
36
|
};
|
package/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { UnionToIntersection } from 'type-fest';
|
|
2
|
-
export
|
|
3
|
-
export
|
|
2
|
+
export type ObjectLiteral = {};
|
|
3
|
+
export type PrimitiveTypeMap = {
|
|
4
4
|
'string': string;
|
|
5
5
|
'number': number;
|
|
6
6
|
'boolean': boolean;
|
|
@@ -10,162 +10,162 @@ export declare type PrimitiveTypeMap = {
|
|
|
10
10
|
'function': Function;
|
|
11
11
|
'undefined': undefined;
|
|
12
12
|
};
|
|
13
|
-
export
|
|
14
|
-
export
|
|
15
|
-
export
|
|
16
|
-
export
|
|
13
|
+
export type PrimitiveTypeString<T extends PrimitiveTypeMap[keyof PrimitiveTypeMap] = PrimitiveTypeMap[keyof PrimitiveTypeMap]> = Simplify<keyof PickBy<PrimitiveTypeMap, T>>;
|
|
14
|
+
export type PrimitiveType<T extends keyof PrimitiveTypeMap = keyof PrimitiveTypeMap> = Simplify<PrimitiveTypeMap[T]>;
|
|
15
|
+
export type Nested<T> = T | NestedObject<T> | NestedArray<T>;
|
|
16
|
+
export type NestedObject<T> = {
|
|
17
17
|
[key: string]: Nested<T>;
|
|
18
18
|
};
|
|
19
|
-
export
|
|
20
|
-
export
|
|
21
|
-
export
|
|
22
|
-
export
|
|
23
|
-
export
|
|
24
|
-
export
|
|
19
|
+
export type NestedArray<T> = T[];
|
|
20
|
+
export type FilledArray<T> = [T, ...(T)[]];
|
|
21
|
+
export type FilledReadonlyArray<T> = readonly [T, ...(T)[]];
|
|
22
|
+
export type Primitive = string | number | boolean | bigint | null | undefined | symbol;
|
|
23
|
+
export type PrimitiveValue = Primitive | PrimitiveObject | PrimitiveArray;
|
|
24
|
+
export type PrimitiveObject = {
|
|
25
25
|
[key: string]: PrimitiveValue;
|
|
26
26
|
};
|
|
27
|
-
export
|
|
28
|
-
export
|
|
29
|
-
export
|
|
30
|
-
export
|
|
31
|
-
export
|
|
27
|
+
export type PrimitiveArray = PrimitiveValue[];
|
|
28
|
+
export type BuiltIn = Primitive | RegExp | Date | Function;
|
|
29
|
+
export type Json = JsonPrimitive | JsonObject | JsonArray;
|
|
30
|
+
export type JsonPrimitive = string | number | boolean | null;
|
|
31
|
+
export type JsonObject = {
|
|
32
32
|
[key: string]: Json;
|
|
33
33
|
};
|
|
34
|
-
export
|
|
35
|
-
export
|
|
36
|
-
export
|
|
37
|
-
export
|
|
38
|
-
export
|
|
34
|
+
export type JsonArray = Json[];
|
|
35
|
+
export type UndefinableJson = JsonPrimitive | UndefinableJsonObject | UndefinableJsonArray;
|
|
36
|
+
export type UndefinableJsonInnerNode = UndefinableJsonPrimitive | UndefinableJsonObject | UndefinableJsonArray;
|
|
37
|
+
export type UndefinableJsonPrimitive = JsonPrimitive | undefined;
|
|
38
|
+
export type UndefinableJsonObject = {
|
|
39
39
|
[key: string]: UndefinableJsonInnerNode;
|
|
40
40
|
};
|
|
41
|
-
export
|
|
42
|
-
export
|
|
43
|
-
export
|
|
44
|
-
export
|
|
45
|
-
export
|
|
46
|
-
export
|
|
47
|
-
export
|
|
41
|
+
export type UndefinableJsonArray = UndefinableJsonInnerNode[];
|
|
42
|
+
export type ArrayItem<T extends readonly any[]> = T extends readonly (infer U)[] ? U : never;
|
|
43
|
+
export type Enumeration = EnumerationArray | EnumerationObject;
|
|
44
|
+
export type EnumerationArray = readonly [string | number, ...(string | number)[]];
|
|
45
|
+
export type EnumerationObject = Record<string, string | number>;
|
|
46
|
+
export type EnumerationKey<T extends EnumerationObject = EnumerationObject> = Extract<keyof T, string>;
|
|
47
|
+
export type EnumerationMap<T extends EnumerationObject = EnumerationObject> = SimplifyObject<{
|
|
48
48
|
[P in EnumerationKey<T>]: (T[P] extends number ? (`${T[P]}` extends `${infer U extends number}` ? U : never) : `${T[P]}`) | T[P];
|
|
49
49
|
}>;
|
|
50
|
-
export
|
|
51
|
-
export
|
|
50
|
+
export type EnumerationValue<T extends Enumeration = Enumeration> = T extends EnumerationObject ? Simplify<EnumerationMap<T>[keyof EnumerationMap<T>]> : T extends EnumerationArray ? T[number] : never;
|
|
51
|
+
export type EnumerationEntry<T extends EnumerationObject = EnumerationObject> = {
|
|
52
52
|
[P in EnumerationKey<T>]: [P, EnumerationMap<T>[P]];
|
|
53
53
|
}[EnumerationKey<T>];
|
|
54
|
-
|
|
54
|
+
type EnumerationEntriesHelper<T extends EnumerationObject = EnumerationObject, Tuple = UnionToTuple<EnumerationKey<T>>> = {
|
|
55
55
|
[P in keyof Tuple]: [Tuple[P], Tuple[P] extends EnumerationKey<T> ? EnumerationMap<T>[Tuple[P]] : never];
|
|
56
56
|
};
|
|
57
|
-
export
|
|
58
|
-
export
|
|
57
|
+
export type EnumerationEntries<T extends EnumerationObject = EnumerationObject> = EnumerationEntriesHelper<T> extends (infer U)[] ? U[] : never;
|
|
58
|
+
export type Type<T = any, Arguments extends any[] = any> = Constructor<T, Arguments> & {
|
|
59
59
|
prototype: T;
|
|
60
60
|
};
|
|
61
|
-
export
|
|
62
|
-
export
|
|
61
|
+
export type Constructor<T = any, Arguments extends any[] = any> = new (...args: Arguments) => T;
|
|
62
|
+
export type AbstractType<T = any, Arguments extends any[] = any> = AbstractConstructor<T, Arguments> & {
|
|
63
63
|
prototype: T;
|
|
64
64
|
};
|
|
65
|
-
export
|
|
66
|
-
export
|
|
67
|
-
export
|
|
65
|
+
export type AbstractConstructor<T = any, Arguments extends any[] = any> = abstract new (...args: Arguments) => T;
|
|
66
|
+
export type ReturnTypeOrT<T> = T extends (...args: any) => infer R ? R : T;
|
|
67
|
+
export type Record<K extends PropertyKey = PropertyKey, V = any> = {
|
|
68
68
|
[P in K]: V;
|
|
69
69
|
};
|
|
70
|
-
export
|
|
70
|
+
export type DeepRecord<K extends PropertyKey = PropertyKey, V = any> = {
|
|
71
71
|
[P in K]: V | DeepRecord<K, V>;
|
|
72
72
|
};
|
|
73
|
-
export
|
|
74
|
-
export
|
|
75
|
-
export
|
|
73
|
+
export type StringMap<T = any> = Record<string, T>;
|
|
74
|
+
export type NumberMap<T = any> = Record<number, T>;
|
|
75
|
+
export type StringNumberMap<T = any> = {
|
|
76
76
|
[key: string]: T;
|
|
77
77
|
[key: number]: T;
|
|
78
78
|
};
|
|
79
|
-
export
|
|
80
|
-
export
|
|
81
|
-
export
|
|
79
|
+
export type OneOrMany<T> = T | readonly T[];
|
|
80
|
+
export type WritableOneOrMany<T> = T | T[];
|
|
81
|
+
export type Writable<T> = {
|
|
82
82
|
-readonly [P in keyof T]: T[P];
|
|
83
83
|
};
|
|
84
|
-
export
|
|
84
|
+
export type RequiredKeys<T> = {
|
|
85
85
|
[K in keyof T]-?: {} extends Pick<T, K> ? never : K;
|
|
86
86
|
}[keyof T];
|
|
87
|
-
export
|
|
87
|
+
export type OptionalKeys<T> = {
|
|
88
88
|
[K in keyof T]-?: {} extends Pick<T, K> ? K : never;
|
|
89
89
|
}[keyof T];
|
|
90
|
-
export
|
|
91
|
-
export
|
|
92
|
-
export
|
|
93
|
-
export
|
|
90
|
+
export type TypedOmit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
|
|
91
|
+
export type TypedExtract<T, U extends T> = T extends U ? T : never;
|
|
92
|
+
export type ReplaceIfUnknown<T, U> = IfUnknown<T, U, T>;
|
|
93
|
+
export type OmitNever<T extends Record> = {
|
|
94
94
|
[K in keyof T as T[K] extends never ? never : K]: T[K];
|
|
95
95
|
};
|
|
96
|
-
export
|
|
96
|
+
export type SharedProperties<A, B, C = unknown, D = unknown, E = unknown, F = unknown, G = unknown, H = unknown, I = unknown, J = unknown> = OmitNever<Pick<A & B & C & D & E & F & G & H & I & J, keyof A & keyof B & keyof ReplaceIfUnknown<C, never> & keyof ReplaceIfUnknown<D, never> & keyof ReplaceIfUnknown<E, never> & keyof ReplaceIfUnknown<F, never> & keyof ReplaceIfUnknown<G, never> & keyof ReplaceIfUnknown<H, never> & keyof ReplaceIfUnknown<I, never> & keyof ReplaceIfUnknown<J, never>>>;
|
|
97
97
|
/**
|
|
98
98
|
* omit properties from a type that extend from a specific type.
|
|
99
99
|
*/
|
|
100
|
-
export
|
|
100
|
+
export type OmitBy<T, V> = Omit<T, {
|
|
101
101
|
[K in keyof T]: V extends Extract<T[K], V> ? K : never;
|
|
102
102
|
}[keyof T]>;
|
|
103
103
|
/**
|
|
104
104
|
* normalize properties of a type that allow `undefined` to make them optional.
|
|
105
105
|
*/
|
|
106
|
-
export
|
|
107
|
-
export
|
|
106
|
+
export type Optionalize<T extends object> = OmitBy<T, undefined> & Partial<PickBy<T, undefined>>;
|
|
107
|
+
export type SimplifiedOptionalize<T extends object> = Simplify<Optionalize<T>>;
|
|
108
108
|
/**
|
|
109
109
|
* remove nested type information
|
|
110
110
|
*/
|
|
111
|
-
export
|
|
111
|
+
export type Simplify<T> = T extends (Primitive | Function | Date | RegExp) ? T : T extends (infer AT)[] ? Simplify<AT>[] : T extends readonly (infer AT)[] ? readonly Simplify<AT>[] : T extends Record ? SimplifyObject<T> : T;
|
|
112
112
|
/**
|
|
113
113
|
* remove type information on object
|
|
114
114
|
*/
|
|
115
|
-
export
|
|
115
|
+
export type SimplifyObject<T extends Record> = {
|
|
116
116
|
[K in keyof T]: T[K];
|
|
117
117
|
} & {};
|
|
118
|
-
export
|
|
119
|
-
export
|
|
118
|
+
export type UnionToTuple<T, Tuple extends any[] = []> = UnionToIntersection<T extends any ? () => T : never> extends () => infer R ? UnionToTuple<Exclude<T, R>, [R, ...Tuple]> : Tuple;
|
|
119
|
+
export type UndefinableObject<T extends Record> = {
|
|
120
120
|
[K in keyof T]: T[K] | undefined;
|
|
121
121
|
};
|
|
122
122
|
/**
|
|
123
123
|
* pick properties from a type that extend from a specific type.
|
|
124
124
|
*/
|
|
125
|
-
export
|
|
125
|
+
export type PickBy<T, V> = Pick<T, {
|
|
126
126
|
[K in keyof T]: V extends Extract<T[K], V> ? K : never;
|
|
127
127
|
}[keyof T]>;
|
|
128
|
-
export
|
|
129
|
-
export
|
|
130
|
-
export
|
|
128
|
+
export type NonNullable<T> = T extends null ? never : T;
|
|
129
|
+
export type NonUndefinable<T> = T extends undefined ? never : T;
|
|
130
|
+
export type NonNullOrUndefinable<T> = T extends null | undefined ? never : T;
|
|
131
131
|
/**
|
|
132
132
|
* makes optional properties required and removes null and undefined
|
|
133
133
|
*/
|
|
134
|
-
export
|
|
134
|
+
export type DeepNonNullable<T> = T extends Record ? {
|
|
135
135
|
[P in keyof T]-?: DeepNonNullable<T[P]>;
|
|
136
136
|
} : NonNullable<T>;
|
|
137
|
-
export
|
|
138
|
-
export
|
|
139
|
-
export
|
|
140
|
-
export
|
|
141
|
-
export
|
|
142
|
-
export
|
|
143
|
-
export
|
|
144
|
-
export
|
|
145
|
-
export
|
|
137
|
+
export type IfAny<T, Then, Else = never> = true extends (false & T) ? Then : Else;
|
|
138
|
+
export type IfUnknown<T, Then, Else = never> = unknown extends T ? Then : Else;
|
|
139
|
+
export type IsAny<T> = IfAny<T, true, false>;
|
|
140
|
+
export type IsUnknown<T> = IfUnknown<T, true, false>;
|
|
141
|
+
export type If<B extends Boolean, Then, Else> = B extends true ? Then : Else;
|
|
142
|
+
export type PartialProperty<T, P extends keyof T> = Omit<T, P> & Partial<Pick<T, P>>;
|
|
143
|
+
export type TypeOf<T extends object, P extends keyof T> = T[P];
|
|
144
|
+
export type PropertyOf<T extends object, P extends keyof T> = Property<Of<T>, P>;
|
|
145
|
+
export type Property<T extends object, P extends keyof T> = {
|
|
146
146
|
[P2 in keyof T[P]]: T[P][P2];
|
|
147
147
|
};
|
|
148
|
-
export
|
|
149
|
-
export
|
|
150
|
-
export
|
|
151
|
-
export
|
|
148
|
+
export type Of<T> = T;
|
|
149
|
+
export type PropertiesOfType<T, U> = keyof PickBy<T, U>;
|
|
150
|
+
export type Flatten<T> = T extends readonly (infer R)[] ? R : T;
|
|
151
|
+
export type DeepFlatten<T> = T extends readonly (infer R)[] ? DeepFlatten<R> : T extends Record ? {
|
|
152
152
|
[P in keyof T]: DeepFlatten<T[P]>;
|
|
153
153
|
} : T;
|
|
154
|
-
export
|
|
155
|
-
export
|
|
156
|
-
export
|
|
154
|
+
export type DeepArray<T> = (T | DeepArray<T>)[];
|
|
155
|
+
export type DeepReadonly<T> = T extends BuiltIn ? T : T extends (any[] | readonly any[]) ? DeepReadonlyArray<T[number]> : DeepReadonlyObject<T>;
|
|
156
|
+
export type DeepReadonlyObject<T> = {
|
|
157
157
|
readonly [P in keyof T]: DeepReadonly<T[P]>;
|
|
158
158
|
};
|
|
159
|
-
export
|
|
160
|
-
export
|
|
161
|
-
export
|
|
159
|
+
export type DeepReadonlyArray<T> = readonly DeepReadonly<T>[];
|
|
160
|
+
export type DeepPartial<T> = T extends BuiltIn ? T : T extends any[] ? DeepPartialArray<T[number]> : T extends readonly any[] ? Readonly<DeepPartialArray<T[number]>> : DeepPartialObject<T>;
|
|
161
|
+
export type DeepPartialObject<T> = {
|
|
162
162
|
[P in keyof T]?: DeepPartial<T[P]>;
|
|
163
163
|
};
|
|
164
|
-
export
|
|
165
|
-
export
|
|
166
|
-
export
|
|
167
|
-
|
|
168
|
-
|
|
164
|
+
export type DeepPartialArray<T> = DeepPartial<T>[];
|
|
165
|
+
export type TypedArray = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array | BigInt64Array | BigUint64Array;
|
|
166
|
+
export type BinaryData = ArrayBuffer | ArrayBufferView;
|
|
167
|
+
type JoinPaths<K, P> = K extends string | number ? P extends string | number ? `${K}${'' extends P ? '' : '.'}${P}` : never : never;
|
|
168
|
+
type Prev = [
|
|
169
169
|
never,
|
|
170
170
|
0,
|
|
171
171
|
1,
|
|
@@ -190,10 +190,10 @@ declare type Prev = [
|
|
|
190
190
|
20,
|
|
191
191
|
...0[]
|
|
192
192
|
];
|
|
193
|
-
export
|
|
193
|
+
export type Paths<T, D extends number = 10> = [D] extends [never] ? never : T extends object ? {
|
|
194
194
|
[K in keyof T]-?: K extends string | number ? `${K}` | (Paths<T[K], Prev[D]> extends infer R ? JoinPaths<K, R> : never) : never;
|
|
195
195
|
}[keyof T] : '';
|
|
196
|
-
export
|
|
196
|
+
export type LeavePaths<T, D extends number = 10> = [D] extends [never] ? never : T extends object ? {
|
|
197
197
|
[K in keyof T]-?: JoinPaths<K, LeavePaths<T[K], Prev[D]>>;
|
|
198
198
|
}[keyof T] : '';
|
|
199
199
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
1
|
+
export type AnyIterable<T> = Iterable<T> | AsyncIterable<T>;
|
|
2
|
+
export type AnyIterator<T> = Iterator<T> | AsyncIterator<T>;
|
|
3
|
+
export type AnyIterableIterator<T> = IterableIterator<T> | AsyncIterableIterator<T>;
|
|
4
4
|
export declare function isAnyIterable<T = any>(obj: any): obj is AnyIterable<T>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export type FeedFunction<T> = (item: T, index: number) => void;
|
|
2
|
+
export type ParallelFeedIteratorFunction<TIn, TOut> = (item: TIn, index: number, feed: FeedFunction<TOut>) => Promise<void>;
|