@tstdl/base 0.78.0-beta31 → 0.78.0-beta32

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.
@@ -1,5 +1,2 @@
1
- declare const template: {
2
- type: string;
3
- templateFile: string;
4
- };
1
+ declare const template: import("../../../templates/providers/file-template.provider").FileTemplate<import("../../../templates").Template<string, any>>;
5
2
  export default template;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tstdl/base",
3
- "version": "0.78.0-beta31",
3
+ "version": "0.78.0-beta32",
4
4
  "author": "Patrick Hein",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -39,7 +39,7 @@
39
39
  "peerDependencies": {
40
40
  "@elastic/elasticsearch": "^8.2",
41
41
  "@koa/router": "^12.0",
42
- "@tstdl/angular": "^0.11.0-beta31",
42
+ "@tstdl/angular": "^0.11.0-beta32",
43
43
  "chroma-js": "^2.4",
44
44
  "got": "^12.3",
45
45
  "handlebars": "^4.7",
@@ -1,7 +1,7 @@
1
1
  import { Schema } from "../../schema";
2
2
  import type { TypedOmit } from "../../types";
3
3
  import type { Template } from '../template.model';
4
- export declare type FileTemplateBase = TypedOmit<Template, 'template'>;
4
+ export declare type FileTemplateBase<T extends Template = Template> = TypedOmit<T, 'template'>;
5
5
  export declare type FileForward<T extends FileTemplateBase, U extends FileTemplateBase> = [fileKey: keyof U, targetKey: keyof T];
6
6
  export declare class FileTemplateProviderBase<T extends FileTemplateBase, U extends FileTemplateBase> {
7
7
  private readonly schema;
@@ -4,7 +4,7 @@ import type { Template } from '../template.model';
4
4
  import type { TemplateProvider } from '../template.provider';
5
5
  import type { FileTemplateBase } from './file-template.provider.base';
6
6
  import { FileTemplateProviderBase } from './file-template.provider.base';
7
- export declare type FileTemplate = FileTemplateBase & {
7
+ export declare type FileTemplate<T extends Template = Template> = FileTemplateBase<T> & {
8
8
  template?: string;
9
9
  /** subject template file */
10
10
  templateFile?: string;
@@ -19,4 +19,4 @@ export declare class FileTemplateProvider extends FileTemplateProviderBase<Templ
19
19
  constructor(basePath: string);
20
20
  }
21
21
  export declare function configureFileTemplateProvider(config?: Partial<FileTemplateProviderConfig>): void;
22
- export declare function fileTemplate<T extends FileTemplate>(template: T): T;
22
+ export declare function fileTemplate<T extends Template = Template>(template: FileTemplate<T>): FileTemplate<T>;
@@ -1 +1 @@
1
- {"version":3,"file":"file-template.provider.js","sourceRoot":"","sources":["../../../source/templates/providers/file-template.provider.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,+CAAwE;AAExE,yCAA6D;AAI7D,+EAAyE;AAe5D,QAAA,0BAA0B,GAA+B,EAAE,CAAC;AAEzE,MAAM,kBAAkB,GAAG,IAAA,eAAM,EAAe;IAC9C,IAAI,EAAE,IAAA,eAAM,GAAE;IACd,QAAQ,EAAE,IAAA,iBAAQ,EAAC,IAAA,eAAM,GAAE,CAAC;IAC5B,YAAY,EAAE,IAAA,iBAAQ,EAAC,IAAA,eAAM,GAAE,CAAC;IAChC,OAAO,EAAE,IAAA,iBAAQ,EAAC,IAAA,gBAAO,GAAE,CAAC;CAC7B,CAAC,CAAC;AAKI,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,sDAAgD;IAGxF,YAAyB,QAAgB;QACvC,KAAK,CAAC,kBAAkB,EAAE,QAAQ,EAAE,CAAC,CAAC,cAAc,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC;IACtE,CAAC;CACF,CAAA;AANY,oBAAoB;IAHhC,IAAA,qBAAS,EAAC;QACT,uBAAuB,EAAE,GAAG,EAAE,CAAC,kCAA0B,CAAC,QAAQ;KACnE,CAAC;IAIa,WAAA,IAAA,qBAAS,GAAE,CAAA;;GAHb,oBAAoB,CAMhC;AANY,oDAAoB;AAQjC,SAAgB,6BAA6B,CAAC,SAA8C,EAAE;IAC5F,kCAA0B,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,IAAI,kCAA0B,CAAC,QAAQ,CAAC;AAC/F,CAAC;AAFD,sEAEC;AAED,SAAgB,YAAY,CAAyB,QAAW;IAC9D,OAAO,QAAQ,CAAC;AAClB,CAAC;AAFD,oCAEC"}
1
+ {"version":3,"file":"file-template.provider.js","sourceRoot":"","sources":["../../../source/templates/providers/file-template.provider.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,+CAAwE;AACxE,yCAA6D;AAI7D,+EAAyE;AAe5D,QAAA,0BAA0B,GAA+B,EAAE,CAAC;AAEzE,MAAM,kBAAkB,GAAG,IAAA,eAAM,EAAe;IAC9C,IAAI,EAAE,IAAA,eAAM,GAAE;IACd,QAAQ,EAAE,IAAA,iBAAQ,EAAC,IAAA,eAAM,GAAE,CAAC;IAC5B,YAAY,EAAE,IAAA,iBAAQ,EAAC,IAAA,eAAM,GAAE,CAAC;IAChC,OAAO,EAAE,IAAA,iBAAQ,EAAC,IAAA,gBAAO,GAAE,CAAC;CAC7B,CAAC,CAAC;AAKI,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,sDAAgD;IAGxF,YAAyB,QAAgB;QACvC,KAAK,CAAC,kBAAkB,EAAE,QAAQ,EAAE,CAAC,CAAC,cAAc,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC;IACtE,CAAC;CACF,CAAA;AANY,oBAAoB;IAHhC,IAAA,qBAAS,EAAC;QACT,uBAAuB,EAAE,GAAG,EAAE,CAAC,kCAA0B,CAAC,QAAQ;KACnE,CAAC;IAIa,WAAA,IAAA,qBAAS,GAAE,CAAA;;GAHb,oBAAoB,CAMhC;AANY,oDAAoB;AAQjC,SAAgB,6BAA6B,CAAC,SAA8C,EAAE;IAC5F,kCAA0B,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,IAAI,kCAA0B,CAAC,QAAQ,CAAC;AAC/F,CAAC;AAFD,sEAEC;AAED,SAAgB,YAAY,CAAgC,QAAyB;IACnF,OAAO,QAAQ,CAAC;AAClB,CAAC;AAFD,oCAEC"}
@@ -14,3 +14,5 @@ export declare class HandlebarsTemplateRenderer extends TemplateRenderer<Handleb
14
14
  canHandleType(type: string): boolean;
15
15
  render(template: HandlebarsTemplate, context?: object): Promise<TemplateRenderResult>;
16
16
  }
17
+ export declare function handlebarsTemplateOptions<T extends HandlebarsTemplateOptions>(options: T): T;
18
+ export declare function handlebarsTemplate<T extends HandlebarsTemplate = HandlebarsTemplate>(template: T): T;
@@ -6,7 +6,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
6
6
  return c > 3 && r && Object.defineProperty(target, key, r), r;
7
7
  };
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.HandlebarsTemplateRenderer = void 0;
9
+ exports.handlebarsTemplate = exports.handlebarsTemplateOptions = exports.HandlebarsTemplateRenderer = void 0;
10
10
  const container_1 = require("../../container");
11
11
  const memoize_1 = require("../../utils/function/memoize");
12
12
  const object_1 = require("../../utils/object/object");
@@ -27,6 +27,14 @@ HandlebarsTemplateRenderer = __decorate([
27
27
  (0, container_1.singleton)()
28
28
  ], HandlebarsTemplateRenderer);
29
29
  exports.HandlebarsTemplateRenderer = HandlebarsTemplateRenderer;
30
+ function handlebarsTemplateOptions(options) {
31
+ return options;
32
+ }
33
+ exports.handlebarsTemplateOptions = handlebarsTemplateOptions;
34
+ function handlebarsTemplate(template) {
35
+ return template;
36
+ }
37
+ exports.handlebarsTemplate = handlebarsTemplate;
30
38
  function _compileHandlebarsTemplate({ template, options = {} }) {
31
39
  const renderer = handlebars.compile(template, {
32
40
  strict: options.strict ?? true,
@@ -1 +1 @@
1
- {"version":3,"file":"handlebars.template-renderer.js","sourceRoot":"","sources":["../../../source/templates/renderers/handlebars.template-renderer.ts"],"names":[],"mappings":";;;;;;;;;AAAA,+CAAwC;AAExC,0DAAyD;AACzD,sDAAwD;AACxD,yDAAgD;AAChD,yCAAyC;AAGzC,4DAAwD;AAWxD,MAAM,yBAAyB,GAAG,IAAA,uBAAa,EAAC,0BAA0B,CAAC,CAAC;AAGrE,IAAM,0BAA0B,GAAhC,MAAM,0BAA2B,SAAQ,oCAAoC;IAClF,aAAa,CAAC,IAAY;QACxB,OAAO,IAAI,IAAI,YAAY,CAAC;IAC9B,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,QAA4B,EAAE,OAAgB;QACzD,MAAM,QAAQ,GAAG,yBAAyB,CAAC,QAAQ,CAAC,CAAC;QACrD,OAAO,QAAQ,CAAC,OAAO,CAAC,CAAC;IAC3B,CAAC;CACF,CAAA;AATY,0BAA0B;IADtC,IAAA,qBAAS,GAAE;GACC,0BAA0B,CAStC;AATY,gEAA0B;AAYvC,SAAS,0BAA0B,CAAC,EAAE,QAAQ,EAAE,OAAO,GAAG,EAAE,EAAsB;IAChF,MAAM,QAAQ,GAAG,UAAU,CAAC,OAAO,CAAC,QAAQ,EAAE;QAC5C,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,IAAI;QAC9B,aAAa,EAAE,OAAO,CAAC,aAAa;QACpC,YAAY,EAAE,IAAA,uBAAS,EAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAA,wBAAe,EAAC,OAAO,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS;QACnG,gBAAgB,EAAE,IAAI;KACvB,CAAC,CAAC;IAEH,OAAO,CAAC,OAAa,EAAE,EAAE,CAAC,QAAQ,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;AACxG,CAAC"}
1
+ {"version":3,"file":"handlebars.template-renderer.js","sourceRoot":"","sources":["../../../source/templates/renderers/handlebars.template-renderer.ts"],"names":[],"mappings":";;;;;;;;;AAAA,+CAAwC;AAExC,0DAAyD;AACzD,sDAAwD;AACxD,yDAAgD;AAChD,yCAAyC;AAGzC,4DAAwD;AAWxD,MAAM,yBAAyB,GAAG,IAAA,uBAAa,EAAC,0BAA0B,CAAC,CAAC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?: Options;
5
5
  };
6
+ export declare function template<T extends Template = Template>(template: T): T;
@@ -1,3 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.template = void 0;
4
+ function template(template) {
5
+ return template;
6
+ }
7
+ exports.template = template;
3
8
  //# sourceMappingURL=template.model.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"template.model.js","sourceRoot":"","sources":["../../source/templates/template.model.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"template.model.js","sourceRoot":"","sources":["../../source/templates/template.model.ts"],"names":[],"mappings":";;;AAMA,SAAgB,QAAQ,CAAgC,QAAW;IACjE,OAAO,QAAQ,CAAC;AAClB,CAAC;AAFD,4BAEC"}