Socket
Socket
Sign inDemoInstall

@types/babel__template

Package Overview
Dependencies
5
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 7.0.3 to 7.4.0

58

babel__template/index.d.ts

@@ -1,2 +0,2 @@

// Type definitions for @babel/template 7.0
// Type definitions for @babel/template 7.4
// Project: https://github.com/babel/babel/tree/master/packages/babel-template, https://babeljs.io

@@ -6,24 +6,47 @@ // Definitions by: Troy Gerwien <https://github.com/yortus>

// Melvin Groenhoff <https://github.com/mgroenhoff>
// ExE Boss <https://github.com/ExE-Boss>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.9
import { ParserOptions } from "@babel/parser";
import { Expression, File, Program, Statement } from "@babel/types";
import { ParserOptions } from '@babel/parser';
import { Expression, Program, Statement } from '@babel/types';
export interface TemplateBuilderOptions extends ParserOptions {
/**
* A set of placeholder names to automatically accept. Items in this list do not need to match the given placeholder pattern.
* A set of placeholder names to automatically accept.
* Items in this list do not need to match `placeholderPattern`.
*
* This option cannot be used when using `%%foo%%` style placeholders.
*/
placeholderWhitelist?: Set<string>;
placeholderWhitelist?: Set<string> | null;
/**
* A pattern to search for when looking for Identifier and StringLiteral nodes that should be considered placeholders. `false` will
* disable placeholder searching entirely, leaving only the `placeholderWhitelist` value to find placeholders.
* A pattern to search for when looking for `Identifier` and `StringLiteral`
* nodes that should be considered as placeholders.
*
* `false` will disable placeholder searching placeholders, leaving only
* the `placeholderWhitelist` value to find replacements.
*
* This option cannot be used when using `%%foo%%` style placeholders.
*
* @default /^[_$A-Z0-9]+$/
*/
placeholderPattern?: RegExp | false;
placeholderPattern?: RegExp | false | null;
/**
* Set this to `true` to preserve any comments from the `code` parameter.
* Set this to `true` to preserve comments from the template string
* into the resulting AST, or `false` to automatically discard comments.
*
* @default false
*/
preserveComments?: boolean;
preserveComments?: boolean | null;
/**
* Set to `true` to use `%%foo%%` style placeholders, `false` to use legacy placeholders
* described by `placeholderPattern` or `placeholderWhitelist`.
*
* When it is not set, it behaves as `true` if there are syntactic placeholders, otherwise as `false`.
*
* @since 7.4.0
*/
syntacticPlaceholders?: boolean | null;
}

@@ -45,12 +68,17 @@

*/
(tpl: TemplateStringsArray, ...args: any[]): (arg?: PublicReplacements) => T;
(tpl: TemplateStringsArray, ...args: unknown[]): (arg?: PublicReplacements) => T;
// Allow users to explicitly create templates that produce ASTs, skipping the need for an intermediate function.
/**
* Allow users to explicitly create templates that produce ASTs,
* skipping the need for an intermediate function.
*
* Does not allow `%%foo%%` style placeholders.
*/
ast: {
(tpl: string, opts?: TemplateBuilderOptions): T;
(tpl: TemplateStringsArray, ...args: any[]): T;
(tpl: TemplateStringsArray, ...args: unknown[]): T;
};
}
export type PublicReplacements = { [index: string]: any; } | any[];
export type PublicReplacements = { [index: string]: unknown } | unknown[];

@@ -57,0 +85,0 @@ export const smart: TemplateBuilder<Statement | Statement[]>;

{
"name": "@types/babel__template",
"version": "7.0.3",
"version": "7.4.0",
"description": "TypeScript definitions for @babel/template",

@@ -21,2 +21,7 @@ "license": "MIT",

"githubUsername": "mgroenhoff"
},
{
"name": "ExE Boss",
"url": "https://github.com/ExE-Boss",
"githubUsername": "ExE-Boss"
}

@@ -36,4 +41,4 @@ ],

},
"typesPublisherContentHash": "726cb6c3eb7a24a445b718bb55b7b52198a7818b525a717728b7eb3d741bdb79",
"typesPublisherContentHash": "dd8063acb40cd7a72bf4860b78c6c992da2e8af35742f5d50e0a13ddbf1520c0",
"typeScriptVersion": "3.2"
}

@@ -11,3 +11,3 @@ # Installation

### Additional Details
* Last updated: Thu, 24 Sep 2020 20:48:09 GMT
* Last updated: Thu, 12 Nov 2020 20:50:56 GMT
* Dependencies: [@types/babel__parser](https://npmjs.com/package/@types/babel__parser), [@types/babel__types](https://npmjs.com/package/@types/babel__types)

@@ -17,2 +17,2 @@ * Global values: none

# Credits
These definitions were written by [Troy Gerwien](https://github.com/yortus), [Marvin Hagemeister](https://github.com/marvinhagemeister), and [Melvin Groenhoff](https://github.com/mgroenhoff).
These definitions were written by [Troy Gerwien](https://github.com/yortus), [Marvin Hagemeister](https://github.com/marvinhagemeister), [Melvin Groenhoff](https://github.com/mgroenhoff), and [ExE Boss](https://github.com/ExE-Boss).
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc