diff --git a/notNeededPackages.json b/notNeededPackages.json index acdb379b38..945f418211 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -720,6 +720,12 @@ "sourceRepoURL": "https://github.com/ivogabe/gulp-typescript", "asOfVersion": "2.13.0" }, + { + "libraryName": "handlebars", + "typingsPackageName": "handlebars", + "sourceRepoURL": "https://github.com/wycats/handlebars.js", + "asOfVersion": "4.1.0" + }, { "libraryName": "handsontable", "typingsPackageName": "handsontable", diff --git a/types/ember-data/tsconfig.json b/types/ember-data/tsconfig.json index f476362aaf..aadbbe7f5f 100644 --- a/types/ember-data/tsconfig.json +++ b/types/ember-data/tsconfig.json @@ -35,6 +35,7 @@ "@ember/runloop/*": ["ember__runloop/*"], "@ember/service": ["ember__service"], "@ember/string": ["ember__string"], + "@ember/string/*": ["ember__string/*"], "@ember/test": ["ember__test"], "@ember/test/*": ["ember__test/*"], "@ember/utils": ["ember__utils"], diff --git a/types/ember-feature-flags/tsconfig.json b/types/ember-feature-flags/tsconfig.json index 957a7a00f8..dc3260af3a 100644 --- a/types/ember-feature-flags/tsconfig.json +++ b/types/ember-feature-flags/tsconfig.json @@ -35,6 +35,7 @@ "@ember/runloop/*": ["ember__runloop/*"], "@ember/service": ["ember__service"], "@ember/string": ["ember__string"], + "@ember/string/*": ["ember__string/*"], "@ember/test": ["ember__test"], "@ember/test/*": ["ember__test/*"], "@ember/utils": ["ember__utils"], diff --git a/types/ember-mocha/tsconfig.json b/types/ember-mocha/tsconfig.json index 4e9b406e2e..c6c6a09f65 100644 --- a/types/ember-mocha/tsconfig.json +++ b/types/ember-mocha/tsconfig.json @@ -35,6 +35,7 @@ "@ember/runloop/*": ["ember__runloop/*"], "@ember/service": ["ember__service"], "@ember/string": ["ember__string"], + "@ember/string/*": ["ember__string/*"], "@ember/test": ["ember__test"], "@ember/test/*": ["ember__test/*"], "@ember/utils": ["ember__utils"], diff --git a/types/ember-modal-dialog/tsconfig.json b/types/ember-modal-dialog/tsconfig.json index 0b0b6f91fb..8fc7a37808 100644 --- a/types/ember-modal-dialog/tsconfig.json +++ b/types/ember-modal-dialog/tsconfig.json @@ -35,6 +35,7 @@ "@ember/runloop/*": ["ember__runloop/*"], "@ember/service": ["ember__service"], "@ember/string": ["ember__string"], + "@ember/string/*": ["ember__string/*"], "@ember/test": ["ember__test"], "@ember/test/*": ["ember__test/*"], "@ember/utils": ["ember__utils"], diff --git a/types/ember-qunit/tsconfig.json b/types/ember-qunit/tsconfig.json index df4899b37c..92a555a59f 100644 --- a/types/ember-qunit/tsconfig.json +++ b/types/ember-qunit/tsconfig.json @@ -35,6 +35,7 @@ "@ember/runloop/*": ["ember__runloop/*"], "@ember/service": ["ember__service"], "@ember/string": ["ember__string"], + "@ember/string/*": ["ember__string/*"], "@ember/test": ["ember__test"], "@ember/test/*": ["ember__test/*"], "@ember/utils": ["ember__utils"], diff --git a/types/ember-resolver/tsconfig.json b/types/ember-resolver/tsconfig.json index bc476c5723..7263220f71 100644 --- a/types/ember-resolver/tsconfig.json +++ b/types/ember-resolver/tsconfig.json @@ -35,6 +35,7 @@ "@ember/runloop/*": ["ember__runloop/*"], "@ember/service": ["ember__service"], "@ember/string": ["ember__string"], + "@ember/string/*": ["ember__string/*"], "@ember/test": ["ember__test"], "@ember/test/*": ["ember__test/*"], "@ember/utils": ["ember__utils"], diff --git a/types/ember-test-helpers/tsconfig.json b/types/ember-test-helpers/tsconfig.json index 2e0ddf49b1..ca139535f3 100644 --- a/types/ember-test-helpers/tsconfig.json +++ b/types/ember-test-helpers/tsconfig.json @@ -35,6 +35,7 @@ "@ember/runloop/*": ["ember__runloop/*"], "@ember/service": ["ember__service"], "@ember/string": ["ember__string"], + "@ember/string/*": ["ember__string/*"], "@ember/test": ["ember__test"], "@ember/test/*": ["ember__test/*"], "@ember/utils": ["ember__utils"], diff --git a/types/ember/index.d.ts b/types/ember/index.d.ts index fbe058a643..d0f9896eb9 100755 --- a/types/ember/index.d.ts +++ b/types/ember/index.d.ts @@ -38,15 +38,17 @@ import { ComputedPropertyCallback, ObserverMethod } from '@ember/object/-private/types'; -import * as HandlebarsNamespace from 'handlebars'; + // Capitalization is intentional: this makes it much easier to re-export RSVP on // the Ember namespace. import Rsvp from 'rsvp'; + import { TemplateFactory } from 'htmlbars-inline-precompile'; import { Registry as ServiceRegistry } from '@ember/service'; import { Registry as ControllerRegistry } from '@ember/controller'; import * as EmberStringNs from '@ember/string'; +import * as EmberStringHandlebarsNs from '@ember/string/-private/handlebars'; // tslint:disable-next-line:no-duplicate-imports import * as EmberServiceNs from '@ember/service'; import * as EmberPolyfillsNs from '@ember/polyfills'; @@ -424,11 +426,12 @@ export namespace Ember { function K(): any; function createFrame(objec: any): any; function Exception(message: string): void; - const SafeString: typeof HandlebarsNamespace.SafeString; + class SafeString extends EmberStringHandlebarsNs.SafeString {} function parse(string: string): any; function print(ast: any): void; const logger: typeof Logger; function log(level: string, str: string): void; + function registerHelper(name: string, helper: any): void; } namespace String { const camelize: typeof EmberStringNs.camelize; diff --git a/types/ember/test/ember-tests.ts b/types/ember/test/ember-tests.ts index 01aaab7452..eb317c3ab1 100755 --- a/types/ember/test/ember-tests.ts +++ b/types/ember/test/ember-tests.ts @@ -92,10 +92,10 @@ App.userController = Ember.Object.create({ }), }); -Handlebars.registerHelper( +Ember.Handlebars.registerHelper( 'highlight', (property: string, options: any) => - new Handlebars.SafeString('' + 'some value' + '') + new Ember.Handlebars.SafeString('' + 'some value' + '') ); const coolView = App.CoolView.create(); diff --git a/types/ember/test/string.ts b/types/ember/test/string.ts index 4363b375f3..d812a52dd5 100644 --- a/types/ember/test/string.ts +++ b/types/ember/test/string.ts @@ -1,5 +1,5 @@ import Ember from 'ember'; -import { SafeString } from 'handlebars'; +import { SafeString } from '@ember/string/-private/handlebars'; const { dasherize, camelize, capitalize, classify, decamelize, htmlSafe, loc, underscore, w } = Ember.String; diff --git a/types/ember/tsconfig.json b/types/ember/tsconfig.json index be47225e72..6e494f5a03 100755 --- a/types/ember/tsconfig.json +++ b/types/ember/tsconfig.json @@ -36,6 +36,7 @@ "@ember/runloop/*": ["ember__runloop/*"], "@ember/service": ["ember__service"], "@ember/string": ["ember__string"], + "@ember/string/*": ["ember__string/*"], "@ember/test": ["ember__test"], "@ember/test/*": ["ember__test/*"], "@ember/utils": ["ember__utils"], diff --git a/types/ember__string/-private/handlebars.d.ts b/types/ember__string/-private/handlebars.d.ts new file mode 100644 index 0000000000..8d8dce118c --- /dev/null +++ b/types/ember__string/-private/handlebars.d.ts @@ -0,0 +1,5 @@ +export class SafeString { + constructor(str: string); + toString(): string; + toHTML(): string; +} diff --git a/types/ember__string/ember__string-tests.ts b/types/ember__string/ember__string-tests.ts index 500c67546e..c6474cd266 100644 --- a/types/ember__string/ember__string-tests.ts +++ b/types/ember__string/ember__string-tests.ts @@ -1,5 +1,5 @@ import { dasherize, camelize, capitalize, classify, decamelize, htmlSafe, loc, underscore, w, isHTMLSafe } from '@ember/string'; -import { SafeString } from 'handlebars'; +import { SafeString } from '@ember/string/-private/handlebars'; dasherize(); // $ExpectError dasherize('blue man group'); // $ExpectType string @@ -37,7 +37,7 @@ const handlebarsSafeString: SafeString = htmlSafe('lorem ipsum...'); htmlSafe('lorem ipsum...'); // $ExpectType SafeString const regularString: string = htmlSafe('lorem ipsum...'); // $ExpectError -function isSafeTest(a: string|Handlebars.SafeString) { +function isSafeTest(a: string | SafeString) { if (isHTMLSafe(a)) { a = a.toString(); } diff --git a/types/ember__string/index.d.ts b/types/ember__string/index.d.ts index c25da1f823..2a65c9b5df 100644 --- a/types/ember__string/index.d.ts +++ b/types/ember__string/index.d.ts @@ -4,7 +4,7 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 -import { SafeString } from 'handlebars'; +import { SafeString } from "./-private/handlebars"; export function camelize(str: string): string; export function capitalize(str: string): string; diff --git a/types/ember__string/tsconfig.json b/types/ember__string/tsconfig.json index 100fad10f5..a5a7ecc944 100644 --- a/types/ember__string/tsconfig.json +++ b/types/ember__string/tsconfig.json @@ -15,13 +15,15 @@ "../" ], "paths": { - "@ember/string": ["ember__string"] + "@ember/string": ["ember__string"], + "@ember/string/*": ["ember__string/*"] }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true }, "files": [ + "-private/handlebars.d.ts", "index.d.ts", "ember__string-tests.ts" ] diff --git a/types/ember__test-helpers/tsconfig.json b/types/ember__test-helpers/tsconfig.json index 7b167f14d5..35638865d8 100644 --- a/types/ember__test-helpers/tsconfig.json +++ b/types/ember__test-helpers/tsconfig.json @@ -38,6 +38,7 @@ "@ember/runloop/*": ["ember__runloop/*"], "@ember/service": ["ember__service"], "@ember/string": ["ember__string"], + "@ember/string/*": ["ember__string/*"], "@ember/test": ["ember__test"], "@ember/test/*": ["ember__test/*"], "@ember/utils": ["ember__utils"], diff --git a/types/ember__test/tsconfig.json b/types/ember__test/tsconfig.json index da00f05337..bb95710392 100644 --- a/types/ember__test/tsconfig.json +++ b/types/ember__test/tsconfig.json @@ -36,6 +36,7 @@ "@ember/runloop/*": ["ember__runloop/*"], "@ember/service": ["ember__service"], "@ember/string": ["ember__string"], + "@ember/string/*": ["ember__string/*"], "@ember/test": ["ember__test"], "@ember/test/*": ["ember__test/*"], "@ember/utils": ["ember__utils"], diff --git a/types/handlebars/handlebars-tests.ts b/types/handlebars/handlebars-tests.ts deleted file mode 100644 index 340bbde590..0000000000 --- a/types/handlebars/handlebars-tests.ts +++ /dev/null @@ -1,87 +0,0 @@ - -//import Handlebars = require('handlebars'); -import * as Handlebars from 'handlebars'; - -const context = { - author: { firstName: 'Alan', lastName: 'Johnson' }, - body: 'I Love Handlebars', - comments: [{ - author: { firstName: 'Yehuda', lastName: 'Katz' }, - body: 'Me too!' - }] -}; -Handlebars.registerHelper('fullName', (person: typeof context.author) => { - return person.firstName + ' ' + person.lastName; -}); - -Handlebars.registerHelper('agree_button', function() { - return new Handlebars.SafeString( - '' - ); -}); - -const source1 = '

Hello, my name is {{name}}. I am from {{hometown}}. I have ' + - '{{kids.length}} kids:

' + - ''; -const template1 = Handlebars.compile(source1); -template1({ name: "Alan", hometown: "Somewhere, TX", kids: [{name: "Jimmy", age: 12}, {name: "Sally", age: 4}]}); - -Handlebars.registerHelper('link_to', (context: typeof post) => { - return '' + context.body + ''; -}); -const post = { url: "/hello-world", body: "Hello World!" }; -const context2 = { posts: [post] }; -const source2 = ''; -const template2: HandlebarsTemplateDelegate<{ posts: { url: string, body: string }[] }> = Handlebars.compile(source2); -template2(context2); - -Handlebars.registerHelper('link_to', (title: string, context: typeof post) => { - return '' + title + '!'; -}); -const context3 = { posts: [{url: '/hello-world', body: 'Hello World!'}] }; -const source3 = ''; -const template3 = Handlebars.compile(source3); -template3(context3); - -const source4 = ''; -Handlebars.registerHelper('link', function(context: any) { - return '' + context.fn(this) + ''; -}); -const template4 = Handlebars.compile<{ people: { name: string, id: number }[] }>(source4); -const data2 = { 'people': [ - { 'name': 'Alan', 'id': 1 }, - { 'name': 'Yehuda', 'id': 2 } -]}; -template4(data2); - -const source5 = ''; -Handlebars.registerPartial('link', '{{name}}'); -const template5 = Handlebars.compile(source5); -const data3 = { 'people': [ - { 'name': 'Alan', 'id': 1 }, - { 'name': 'Yehuda', 'id': 2 } -]}; -template5(data3); - -const source6 = '{{#list nav}}{{title}}{{/list}}'; -const template6 = Handlebars.compile(source6); -Handlebars.registerHelper('list', (context, options: Handlebars.HelperOptions) => { - let ret = ""; -}); -template6([{url:"", title:""}]) - - -const escapedExpression = Handlebars.Utils.escapeExpression(''); - -Handlebars.helpers !== undefined; - -const parsedTmpl = Handlebars.parse('

Hello, my name is {{name}}.

', { - srcName: "/foo/bar/baz.hbs", - ignoreStandalone: true -}); - -const parsedTmplWithoutOptions = Handlebars.parse('

Hello, my name is {{name}}.

'); diff --git a/types/handlebars/index.d.ts b/types/handlebars/index.d.ts deleted file mode 100644 index d6bebcb457..0000000000 --- a/types/handlebars/index.d.ts +++ /dev/null @@ -1,349 +0,0 @@ -// Type definitions for Handlebars v4.0.11 -// Project: http://handlebarsjs.com/ -// Definitions by: Boris Yankov , Sergei Dorogin -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 - -declare namespace Handlebars { - export interface TemplateDelegate { - (context: T, options?: RuntimeOptions): string; - } - - export type Template = TemplateDelegate|string; - - export interface RuntimeOptions { - partial?: boolean; - depths?: any[]; - helpers?: { [name: string]: Function }; - partials?: { [name: string]: HandlebarsTemplateDelegate }; - decorators?: { [name: string]: Function }; - data?: any; - blockParams?: any[]; - } - - export interface HelperOptions { - fn: TemplateDelegate; - inverse: TemplateDelegate; - hash: any; - data?: any; - } - - export interface HelperDelegate { - (context?: any, arg1?: any, arg2?: any, arg3?: any, arg4?: any, arg5?: any, options?: HelperOptions): any; - } - export interface HelperDeclareSpec { - [key: string]: HelperDelegate; - } - - export interface ParseOptions { - srcName?: string, - ignoreStandalone?: boolean - } - - export function registerHelper(name: string, fn: HelperDelegate): void; - export function registerHelper(name: HelperDeclareSpec): void; - export function unregisterHelper(name: string): void; - - export function registerPartial(name: string, fn: Template): void; - export function registerPartial(spec: { [name: string]: HandlebarsTemplateDelegate }): void; - export function unregisterPartial(name: string): void; - - // TODO: replace Function with actual signature - export function registerDecorator(name: string, fn: Function): void; - export function unregisterDecorator(name: string): void; - - export function K(): void; - export function createFrame(object: any): any; - export function blockParams(obj: any[], ids: any[]): any[]; - export function Exception(message: string): void; - export function log(level: number, obj: any): void; - export function parse(input: string, options?: ParseOptions): hbs.AST.Program; - export function compile(input: any, options?: CompileOptions): HandlebarsTemplateDelegate; - export function precompile(input: any, options?: PrecompileOptions): TemplateSpecification; - export function template(precompilation: TemplateSpecification): HandlebarsTemplateDelegate; - - export function create(): typeof Handlebars; - - export const escapeExpression: typeof Utils.escapeExpression; - //export const Utils: typeof hbs.Utils; - export const logger: Logger; - export const templates: HandlebarsTemplates; - export const helpers: { [name: string]: HelperDelegate }; - export const partials: { [name: string]: any }; - // TODO: replace Function with actual signature - export const decorators: { [name: string]: Function }; - - export function noConflict(): typeof Handlebars; - - export class SafeString { - constructor(str: string); - toString(): string; - toHTML(): string; - } - - export namespace Utils { - export function escapeExpression(str: string): string; - export function createFrame(object: any): any; - export function blockParams(obj: any[], ids: any[]): any[]; - export function isEmpty(obj: any) : boolean; - export function extend(obj: any, ...source: any[]): any; - export function toString(obj: any): string; - export function isArray(obj: any): boolean; - export function isFunction(obj: any): boolean; - } - - export namespace AST { - export const helpers: hbs.AST.helpers; - } - - interface ICompiler { - accept(node: hbs.AST.Node): void; - Program(program: hbs.AST.Program): void; - BlockStatement(block: hbs.AST.BlockStatement): void; - PartialStatement(partial: hbs.AST.PartialStatement): void; - PartialBlockStatement(partial: hbs.AST.PartialBlockStatement): void; - DecoratorBlock(decorator: hbs.AST.DecoratorBlock): void; - Decorator(decorator: hbs.AST.Decorator): void; - MustacheStatement(mustache: hbs.AST.MustacheStatement): void; - ContentStatement(content: hbs.AST.ContentStatement): void; - CommentStatement(comment?: hbs.AST.CommentStatement): void; - SubExpression(sexpr: hbs.AST.SubExpression): void; - PathExpression(path: hbs.AST.PathExpression): void; - StringLiteral(str: hbs.AST.StringLiteral): void; - NumberLiteral(num: hbs.AST.NumberLiteral): void; - BooleanLiteral(bool: hbs.AST.BooleanLiteral): void; - UndefinedLiteral(): void; - NullLiteral(): void; - Hash(hash: hbs.AST.Hash): void; - } - - export class Visitor implements ICompiler { - accept(node: hbs.AST.Node): void; - acceptKey(node: hbs.AST.Node, name: string): void; - acceptArray(arr: hbs.AST.Expression[]): void; - Program(program: hbs.AST.Program): void; - BlockStatement(block: hbs.AST.BlockStatement): void; - PartialStatement(partial: hbs.AST.PartialStatement): void; - PartialBlockStatement(partial: hbs.AST.PartialBlockStatement): void; - DecoratorBlock(decorator: hbs.AST.DecoratorBlock): void; - Decorator(decorator: hbs.AST.Decorator): void; - MustacheStatement(mustache: hbs.AST.MustacheStatement): void; - ContentStatement(content: hbs.AST.ContentStatement): void; - CommentStatement(comment?: hbs.AST.CommentStatement): void; - SubExpression(sexpr: hbs.AST.SubExpression): void; - PathExpression(path: hbs.AST.PathExpression): void; - StringLiteral(str: hbs.AST.StringLiteral): void; - NumberLiteral(num: hbs.AST.NumberLiteral): void; - BooleanLiteral(bool: hbs.AST.BooleanLiteral): void; - UndefinedLiteral(): void; - NullLiteral(): void; - Hash(hash: hbs.AST.Hash): void; - } -} - -/** -* Implement this interface on your MVW/MVVM/MVC views such as Backbone.View -**/ -interface HandlebarsTemplatable { - template: HandlebarsTemplateDelegate; -} - -// NOTE: for backward compatibility of this typing -type HandlebarsTemplateDelegate = Handlebars.TemplateDelegate; - -interface HandlebarsTemplates { - [index: string]: HandlebarsTemplateDelegate; -} - -interface TemplateSpecification { - -} - -// for backward compatibility of this typing -type RuntimeOptions = Handlebars.RuntimeOptions; - -interface CompileOptions { - data?: boolean; - compat?: boolean; - knownHelpers?: { - helperMissing?: boolean; - blockHelperMissing?: boolean; - each?: boolean; - if?: boolean; - unless?: boolean; - with?: boolean; - log?: boolean; - lookup?: boolean; - }; - knownHelpersOnly?: boolean; - noEscape?: boolean; - strict?: boolean; - assumeObjects?: boolean; - preventIndent?: boolean; - ignoreStandalone?: boolean; - explicitPartialContext?: boolean; -} - -interface PrecompileOptions extends CompileOptions { - srcName?: string; - destName?: string; -} - -declare namespace hbs { - // for backward compatibility of this typing - type SafeString = Handlebars.SafeString; - - type Utils = typeof Handlebars.Utils; -} - -interface Logger { - DEBUG: number; - INFO: number; - WARN: number; - ERROR: number; - level: number; - - methodMap: { [level: number]: string }; - - log(level: number, obj: string): void; -} - -declare namespace hbs { - namespace AST { - interface Node { - type: string; - loc: SourceLocation; - } - - interface SourceLocation { - source: string; - start: Position; - end: Position; - } - - interface Position { - line: number; - column: number; - } - - interface Program extends Node { - body: Statement[]; - blockParams: string[]; - } - - interface Statement extends Node {} - - interface MustacheStatement extends Statement { - path: PathExpression | Literal; - params: Expression[]; - hash: Hash; - escaped: boolean; - strip: StripFlags; - } - - interface Decorator extends MustacheStatement { } - - interface BlockStatement extends Statement { - path: PathExpression; - params: Expression[]; - hash: Hash; - program: Program; - inverse: Program; - openStrip: StripFlags; - inverseStrip: StripFlags; - closeStrip: StripFlags; - } - - interface DecoratorBlock extends BlockStatement { } - - interface PartialStatement extends Statement { - name: PathExpression | SubExpression; - params: Expression[]; - hash: Hash; - indent: string; - strip: StripFlags; - } - - interface PartialBlockStatement extends Statement { - name: PathExpression | SubExpression; - params: Expression[]; - hash: Hash; - program: Program; - openStrip: StripFlags; - closeStrip: StripFlags; - } - - interface ContentStatement extends Statement { - value: string; - original: StripFlags; - } - - interface CommentStatement extends Statement { - value: string; - strip: StripFlags; - } - - interface Expression extends Node {} - - interface SubExpression extends Expression { - path: PathExpression; - params: Expression[]; - hash: Hash; - } - - interface PathExpression extends Expression { - data: boolean; - depth: number; - parts: string[]; - original: string; - } - - interface Literal extends Expression {} - interface StringLiteral extends Literal { - value: string; - original: string; - } - - interface BooleanLiteral extends Literal { - value: boolean; - original: boolean; - } - - interface NumberLiteral extends Literal { - value: number; - original: number; - } - - interface UndefinedLiteral extends Literal {} - - interface NullLiteral extends Literal {} - - interface Hash extends Node { - pairs: HashPair[]; - } - - interface HashPair extends Node { - key: string; - value: Expression; - } - - interface StripFlags { - open: boolean; - close: boolean; - } - - interface helpers { - helperExpression(node: Node): boolean; - scopeId(path: PathExpression): boolean; - simpleId(path: PathExpression): boolean; - } - } -} - -declare module "handlebars" { - export = Handlebars; -} - -declare module "handlebars/runtime" { - export = Handlebars; -} diff --git a/types/handlebars/tsconfig.json b/types/handlebars/tsconfig.json deleted file mode 100644 index 0008e2154e..0000000000 --- a/types/handlebars/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "files": [ - "index.d.ts", - "handlebars-tests.ts" - ], - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": false, - "strictNullChecks": false, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - } -} diff --git a/types/handlebars/tslint.json b/types/handlebars/tslint.json deleted file mode 100644 index a41bf5d19a..0000000000 --- a/types/handlebars/tslint.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "extends": "dtslint/dt.json", - "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false - } -} diff --git a/types/handlebars/v1/index.d.ts b/types/handlebars/v1/index.d.ts deleted file mode 100644 index a66c8f7ee6..0000000000 --- a/types/handlebars/v1/index.d.ts +++ /dev/null @@ -1,184 +0,0 @@ -// Type definitions for Handlebars 1.0 -// Project: http://handlebarsjs.com/ -// Definitions by: Boris Yankov -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - - -// Use either HandlebarsStatic or HandlebarsRuntimeStatic -declare var Handlebars: HandlebarsStatic; -//declare var Handlebars: HandlebarsRuntimeStatic; - -/** -* Implement this interface on your MVW/MVVM/MVC views such as Backbone.View -**/ -interface HandlebarsTemplatable { - template: HandlebarsTemplateDelegate; -} - -interface HandlebarsTemplateDelegate { - (context: any, options?: any): string; -} - -interface HandlebarsCommon { - registerHelper(name: string, fn: Function, inverse?: boolean): void; - registerPartial(name: string, str: any): void; - K(): void; - createFrame(object: any): any; - - Exception(message: string): void; - SafeString: typeof hbs.SafeString; - Utils: typeof hbs.Utils; - - logger: Logger; - log(level: number, obj: any): void; -} - -interface HandlebarsStatic extends HandlebarsCommon { - parse(input: string): hbs.AST.ProgramNode; - compile(input: any, options?: any): HandlebarsTemplateDelegate; -} - -interface HandlebarsTemplates { - [index: string]: HandlebarsTemplateDelegate; -} - -interface HandlebarsRuntimeStatic extends HandlebarsCommon { - // Handlebars.templates is the default template namespace in precompiler. - templates: HandlebarsTemplates; -} - -declare namespace hbs { - class SafeString { - constructor(str: string); - static toString(): string; - } - - namespace Utils { - function escapeExpression(str: string): string; - } -} - -interface Logger { - DEBUG: number; - INFO: number; - WARN: number; - ERROR: number; - level: number; - - methodMap: { [level: number]: string }; - - log(level: number, obj: string): void; -} - -declare namespace hbs { - namespace AST { - interface IStripInfo { - left?: boolean; - right?: boolean; - inlineStandalone?: boolean; - } - - class NodeBase { - firstColumn: number; - firstLine: number; - lastColumn: number; - lastLine: number; - type: string; - } - - class ProgramNode extends NodeBase { - statements: NodeBase[]; - } - - class IdNode extends NodeBase { - original: string; - parts: string[]; - string: string; - depth: number; - idName: string; - isSimple: boolean; - stringModeValue: string; - } - - class HashNode extends NodeBase { - pairs: {0: string; - 1: NodeBase}[]; - } - - class SexprNode extends NodeBase { - hash: HashNode; - id: NodeBase; - params: NodeBase[]; - isHelper: boolean; - eligibleHelper: boolean; - } - - class MustacheNode extends NodeBase { - strip: IStripInfo; - escaped: boolean; - sexpr: SexprNode; - - } - - class BlockNode extends NodeBase { - mustache: MustacheNode; - program: ProgramNode; - inverse: ProgramNode; - strip: IStripInfo; - isInverse: boolean; - } - - class PartialNameNode extends NodeBase { - name: string; - } - - class PartialNode extends NodeBase { - partialName: PartialNameNode; - context: NodeBase; - hash: HashNode; - strip: IStripInfo; - } - - class RawBlockNode extends NodeBase { - mustache: MustacheNode; - program: ProgramNode; - } - - class ContentNode extends NodeBase { - original: string; - string: string; - } - - class DataNode extends NodeBase { - id: IdNode; - stringModeValue: string; - idName: string; - } - - class StringNode extends NodeBase { - original: string; - string: string; - stringModeValue: string; - } - - class NumberNode extends NodeBase { - original: string; - number: string; - stringModeValue: number; - } - - class BooleanNode extends NodeBase { - bool: string; - stringModeValue: boolean; - } - - class CommentNode extends NodeBase { - comment: string; - strip: IStripInfo; - } - } -} - -declare module "handlebars" { - export = Handlebars; -} diff --git a/types/handlebars/v1/tsconfig.json b/types/handlebars/v1/tsconfig.json deleted file mode 100644 index 96818b903b..0000000000 --- a/types/handlebars/v1/tsconfig.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "baseUrl": "../../", - "typeRoots": [ - "../../" - ], - "types": [], - "paths": { - "handlebars": [ - "handlebars/v1" - ] - }, - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts" - ] -} \ No newline at end of file diff --git a/types/handlebars/v1/tslint.json b/types/handlebars/v1/tslint.json deleted file mode 100644 index a41bf5d19a..0000000000 --- a/types/handlebars/v1/tslint.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "extends": "dtslint/dt.json", - "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false - } -} diff --git a/types/vision/package.json b/types/vision/package.json new file mode 100644 index 0000000000..b6f5204c9a --- /dev/null +++ b/types/vision/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "handlebars": "^4.1.0" + } +} \ No newline at end of file