doT.d.ts 758 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. declare namespace doT {
  2. function template(
  3. tmpl: string,
  4. cfg?: Partial<TemplateSettings>,
  5. def?: Definitions
  6. ): TemplateFunction
  7. function compile(tmpl: string, def?: Definitions): TemplateFunction
  8. function setDelimiters({start, end}: Delimiters): void
  9. interface TemplateSettings {
  10. argName: string | string[]
  11. encoders: {
  12. [key: string]: Encoder
  13. }
  14. selfContained: boolean
  15. strip: boolean
  16. internalPrefix: string
  17. encodersPrefix: string
  18. delimiters: Delimiters
  19. }
  20. type TemplateFunction = (data: any) => string
  21. interface Definitions {
  22. [key: string]: string | Function | any
  23. }
  24. type Encoder = (data: any) => string
  25. type Delimiters = {
  26. start: string
  27. end: string
  28. }
  29. }
  30. export = doT