Socket
Socket
Sign inDemoInstall

lit-html

Package Overview
Dependencies
Maintainers
10
Versions
102
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lit-html - npm Package Compare versions

Comparing version 1.2.1 to 1.3.0-pre.1

ts3.4/test/test-utils/security.d.ts

10

CHANGELOG.md

@@ -20,6 +20,14 @@ # Change Log

## [1.3.0-pre.1] - 2020-07-28
### Changed
* Set the "type" field in package.json to "module. ([#1146](https://github.com/Polymer/lit-html/pull/1146))
### Added
* Added support for [Trusted Types](https://github.com/WICG/trusted-types). This support uses a policy named 'lit-html' for parsing the static parts of html literals, and ensures that we pass trusted type values through to the DOM when used in bindings. ([#1153](https://github.com/Polymer/lit-html/pull/1153))
* Export the `shadyTemplateFactory` from `lib/shady-render.js` ([#1135](https://github.com/Polymer/lit-html/pull/1135))
## [1.2.1] - 2020-03-19
### Fixed
* Add TypeScript type declarations for older versions of TypeScript. We're currently testing back to TS 3.4. We can't commit to never breaking TypeScript builds, but we'll be supporting older versions as best we can.
* Added TypeScript type declarations for older versions of TypeScript. We're currently testing back to TS 3.4. We can't commit to never breaking TypeScript builds, but we'll be supporting older versions as best we can.

@@ -26,0 +34,0 @@ ## [1.2.0] - 2020-03-18

@@ -23,2 +23,3 @@ /**

const previousValues = new WeakMap();
const isIe = window.navigator.userAgent.indexOf('Trident/') > 0;
/**

@@ -41,5 +42,16 @@ * Renders the result as SVG, rather than text.

const template = document.createElement('template');
template.innerHTML = `<svg>${value}</svg>`;
const content = template.content;
const svgElement = content.firstChild;
let svgElement;
if (isIe) {
// IE can't set innerHTML of an svg element. However, it also doesn't
// support Trusted Types, so it's ok for us to use a string when setting
// innerHTML.
template.innerHTML = `<svg>${value}</svg>`;
svgElement = content.firstChild;
}
else {
svgElement = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
content.appendChild(svgElement);
svgElement.innerHTML = value;
}
content.removeChild(svgElement);

@@ -46,0 +58,0 @@ reparentNodes(content, svgElement.firstChild);

3

lib/default-template-processor.d.ts

@@ -14,5 +14,2 @@ /**

*/
/**
* @module lit-html
*/
import { Part } from './part.js';

@@ -19,0 +16,0 @@ import { NodePart } from './parts.js';

@@ -14,5 +14,2 @@ /**

*/
/**
* @module lit-html
*/
import { Part } from './part.js';

@@ -19,0 +16,0 @@ export declare type DirectiveFactory = (...args: any[]) => object;

@@ -14,5 +14,2 @@ /**

*/
/**
* @module shady-render
*/
import { Template } from './template.js';

@@ -19,0 +16,0 @@ /**

@@ -14,5 +14,2 @@ /**

*/
/**
* @module shady-render
*/
import { isTemplatePartActive } from './template.js';

@@ -19,0 +16,0 @@ const walkerNodeFilter = 133 /* NodeFilter.SHOW_{ELEMENT|COMMENT|TEXT} */;

@@ -15,5 +15,2 @@ /**

/**
* @module lit-html
*/
/**
* The Part interface represents a dynamic part of a template instance rendered

@@ -20,0 +17,0 @@ * by lit-html.

@@ -14,5 +14,2 @@ /**

*/
/**
* @module lit-html
*/
import { isDirective } from './directive.js';

@@ -58,6 +55,29 @@ import { removeNodes } from './dom.js';

const l = strings.length - 1;
const parts = this.parts;
// If we're assigning an attribute via syntax like:
// attr="${foo}" or attr=${foo}
// but not
// attr="${foo} ${bar}" or attr="${foo} baz"
// then we don't want to coerce the attribute value into one long
// string. Instead we want to just return the value itself directly,
// so that sanitizeDOMValue can get the actual value rather than
// String(value)
// The exception is if v is an array, in which case we do want to smash
// it together into a string without calling String() on the array.
//
// This also allows trusted values (when using TrustedTypes) being
// assigned to DOM sinks without being stringified in the process.
if (l === 1 && strings[0] === '' && strings[1] === '') {
const v = parts[0].value;
if (typeof v === 'symbol') {
return String(v);
}
if (typeof v === 'string' || !isIterable(v)) {
return v;
}
}
let text = '';
for (let i = 0; i < l; i++) {
text += strings[i];
const part = this.parts[i];
const part = parts[i];
if (part !== undefined) {

@@ -64,0 +84,0 @@ const v = part.value;

@@ -14,5 +14,2 @@ /**

*/
/**
* @module lit-html
*/
import { TemplateFactory } from './template-factory.js';

@@ -19,0 +16,0 @@ export interface RenderOptions {

@@ -14,5 +14,2 @@ /**

*/
/**
* @module lit-html
*/
import { removeNodes } from './dom.js';

@@ -19,0 +16,0 @@ import { NodePart } from './parts.js';

@@ -15,3 +15,10 @@ /**

import { RenderOptions } from './render-options.js';
import { TemplateResult } from './template-result.js';
import { Template } from './template.js';
export { html, svg, TemplateResult } from '../lit-html.js';
/**
* Template factory which scopes template DOM using ShadyCSS.
* @param scopeName {string}
*/
export declare const shadyTemplateFactory: (scopeName: string) => (result: TemplateResult) => Template;
export interface ShadyRenderOptions extends Partial<RenderOptions> {

@@ -18,0 +25,0 @@ scopeName: string;

@@ -18,4 +18,3 @@ /**

*
* @module shady-render
* @preferred
* @packageDocumentation
*/

@@ -49,3 +48,3 @@ /**

*/
const shadyTemplateFactory = (scopeName) => (result) => {
export const shadyTemplateFactory = (scopeName) => (result) => {
const cacheKey = getTemplateCacheKey(result.type, scopeName);

@@ -52,0 +51,0 @@ let templateCache = templateCaches.get(cacheKey);

@@ -14,5 +14,2 @@ /**

*/
/**
* @module lit-html
*/
import { TemplateResult } from './template-result.js';

@@ -19,0 +16,0 @@ import { Template } from './template.js';

@@ -14,5 +14,2 @@ /**

*/
/**
* @module lit-html
*/
import { isCEPolyfill } from './dom.js';

@@ -19,0 +16,0 @@ import { isTemplatePartActive } from './template.js';

@@ -22,9 +22,18 @@ /**

/**
* Create parts for an attribute-position binding, given the event, attribute
* name, and string literals.
* Create parts for an attribute-position binding, given the element,
* attribute name, and string literals.
*
* @param element The element containing the binding
* @param name The attribute name
* @param strings The string literals. There are always at least two strings,
* event for fully-controlled bindings with a single expression.
* @param name The attribute name, including a possible prefix. The name may
* be prefixed by `.` (for a property binding), `@` (for an event binding)
* or
* `?` (for a boolean attribute binding).
* @param strings The array of literal strings that form the static part of
* the
* attribute value. There are always at least two strings,
* even for fully-controlled bindings with a single expression. For example,
* for the binding `attr="${e1}-${e2}"`, the `strings` array includes three
* strings (`['', '-', '']`)—the text _before_ the first expression (the
* empty string), the text between the two expressions (`'-'`), and the text
* after the last expression (another empty string).
*/

@@ -31,0 +40,0 @@ handleAttributeExpressions(element: Element, name: string, strings: ReadonlyArray<string>, options: RenderOptions): ReadonlyArray<Part>;

@@ -19,2 +19,12 @@ /**

import { boundAttributeSuffix, lastAttributeNameRegex, marker, nodeMarker } from './template.js';
/**
* Our TrustedTypePolicy for HTML which is declared using the html template
* tag function.
*
* That HTML is a developer-authored constant, and is parsed with innerHTML
* before any untrusted expressions have been mixed in. Therefor it is
* considered safe by construction.
*/
const policy = window.trustedTypes &&
trustedTypes.createPolicy('lit-html', { createHTML: (s) => s });
const commentMarker = ` ${marker} `;

@@ -90,3 +100,11 @@ /**

const template = document.createElement('template');
template.innerHTML = this.getHTML();
let value = this.getHTML();
if (policy !== undefined) {
// this is secure because `this.strings` is a TemplateStringsArray.
// TODO: validate this when
// https://github.com/tc39/proposal-array-is-template-object is
// implemented.
value = policy.createHTML(value);
}
template.innerHTML = value;
return template;

@@ -93,0 +111,0 @@ }

@@ -14,5 +14,2 @@ /**

*/
/**
* @module lit-html
*/
import { TemplateResult } from './template-result.js';

@@ -19,0 +16,0 @@ /**

@@ -24,4 +24,3 @@ /**

*
* @module lit-html
* @preferred
* @packageDocumentation
*/

@@ -49,3 +48,3 @@ /**

if (typeof window !== 'undefined') {
(window['litHtmlVersions'] || (window['litHtmlVersions'] = [])).push('1.2.1');
(window['litHtmlVersions'] || (window['litHtmlVersions'] = [])).push('1.3.0-pre.1');
}

@@ -52,0 +51,0 @@ /**

{
"name": "lit-html",
"version": "1.2.1",
"version": "1.3.0-pre.1",
"description": "HTML template literals in JavaScript",

@@ -8,2 +8,3 @@ "license": "BSD-3-Clause",

"repository": "Polymer/lit-html",
"type": "module",
"main": "lit-html.js",

@@ -42,3 +43,3 @@ "module": "lit-html.js",

"lint:eslint": "eslint 'src/**/*.{js,ts}'",
"prepublishOnly": "node check-version-tracker.js && npm run lint && npm test",
"prepublishOnly": "node check-version-tracker.cjs && npm run lint && npm test",
"prepare": "npm run build",

@@ -52,4 +53,5 @@ "publish-dev": "npm test && VERSION=${npm_package_version%-*}-dev.`git rev-parse --short HEAD` && npm version --no-git-tag-version $VERSION && npm publish --tag dev"

"@types/mocha": "^7.0.1",
"@typescript-eslint/eslint-plugin": "^2.10.0",
"@typescript-eslint/parser": "^2.10.0",
"@types/trusted-types": "^1.0.1",
"@typescript-eslint/eslint-plugin": "^2.26.0",
"@typescript-eslint/parser": "^2.26.0",
"@webcomponents/shadycss": "^1.8.0",

@@ -60,5 +62,5 @@ "@webcomponents/webcomponentsjs": "^2.4.2",

"downlevel-dts": "^0.4.0",
"eslint": "^6.7.0",
"husky": "^3.1.0",
"lint-staged": "^9.5.0",
"eslint": "^6.8.0",
"husky": "^4.2.0",
"lint-staged": "^10.1.0",
"lit-html-benchmarks": "^0.2.1",

@@ -72,3 +74,3 @@ "mocha": "^7.0.1",

"uglify-es": "^3.3.5",
"wct-mocha": "^1.0.0",
"wct-mocha": "^1.1.0",
"web-component-tester": "^6.9.0"

@@ -83,6 +85,5 @@ },

"src/**/*.{js,ts}": [
"eslint --fix",
"git add"
"eslint --fix"
]
}
}

@@ -13,3 +13,3 @@ # lit-html

Docs source is in the `docs` folder. To build the site youself, see the instructions in [docs/README.md](docs/README.md).
Docs source is in the `docs` folder. To build the site yourself, see the instructions in [docs/README.md](docs/README.md).

@@ -16,0 +16,0 @@ ## Overview

@@ -31,2 +31,4 @@ /**

const isIe = window.navigator.userAgent.indexOf('Trident/') > 0;
/**

@@ -52,5 +54,15 @@ * Renders the result as SVG, rather than text.

const template = document.createElement('template');
template.innerHTML = `<svg>${value}</svg>`;
const content = template.content;
const svgElement = content.firstChild!;
let svgElement;
if (isIe) {
// IE can't set innerHTML of an svg element. However, it also doesn't
// support Trusted Types, so it's ok for us to use a string when setting
// innerHTML.
template.innerHTML = `<svg>${value}</svg>`;
svgElement = content.firstChild!;
} else {
svgElement = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
content.appendChild(svgElement);
svgElement.innerHTML = value as string;
}
content.removeChild(svgElement);

@@ -57,0 +69,0 @@ reparentNodes(content, svgElement.firstChild);

@@ -15,6 +15,2 @@ /**

/**
* @module lit-html
*/
import {Part} from './part.js';

@@ -21,0 +17,0 @@ import {AttributeCommitter, BooleanAttributePart, EventPart, NodePart, PropertyCommitter} from './parts.js';

@@ -15,6 +15,2 @@ /**

/**
* @module lit-html
*/
import {Part} from './part.js';

@@ -21,0 +17,0 @@

@@ -15,6 +15,2 @@ /**

/**
* @module lit-html
*/
interface MaybePolyfilledCe extends CustomElementRegistry {

@@ -21,0 +17,0 @@ readonly polyfillWrapFlushCallback?: object;

@@ -15,6 +15,2 @@ /**

/**
* @module shady-render
*/
import {isTemplatePartActive, Template, TemplatePart} from './template.js';

@@ -21,0 +17,0 @@

@@ -16,6 +16,2 @@ /**

/**
* @module lit-html
*/
/**
* The Part interface represents a dynamic part of a template instance rendered

@@ -22,0 +18,0 @@ * by lit-html.

@@ -15,6 +15,2 @@ /**

/**
* @module lit-html
*/
import {isDirective} from './directive.js';

@@ -73,2 +69,26 @@ import {removeNodes} from './dom.js';

const l = strings.length - 1;
const parts = this.parts;
// If we're assigning an attribute via syntax like:
// attr="${foo}" or attr=${foo}
// but not
// attr="${foo} ${bar}" or attr="${foo} baz"
// then we don't want to coerce the attribute value into one long
// string. Instead we want to just return the value itself directly,
// so that sanitizeDOMValue can get the actual value rather than
// String(value)
// The exception is if v is an array, in which case we do want to smash
// it together into a string without calling String() on the array.
//
// This also allows trusted values (when using TrustedTypes) being
// assigned to DOM sinks without being stringified in the process.
if (l === 1 && strings[0] === '' && strings[1] === '') {
const v = parts[0].value;
if (typeof v === 'symbol') {
return String(v);
}
if (typeof v === 'string' || !isIterable(v)) {
return v;
}
}
let text = '';

@@ -78,3 +98,3 @@

text += strings[i];
const part = this.parts[i];
const part = parts[i];
if (part !== undefined) {

@@ -81,0 +101,0 @@ const v = part.value;

@@ -15,6 +15,2 @@ /**

/**
* @module lit-html
*/
import {TemplateFactory} from './template-factory.js';

@@ -21,0 +17,0 @@

@@ -15,6 +15,2 @@ /**

/**
* @module lit-html
*/
import {removeNodes} from './dom.js';

@@ -21,0 +17,0 @@ import {NodePart} from './parts.js';

@@ -19,4 +19,3 @@ /**

*
* @module shady-render
* @preferred
* @packageDocumentation
*/

@@ -59,3 +58,3 @@

*/
const shadyTemplateFactory = (scopeName: string) =>
export const shadyTemplateFactory = (scopeName: string) =>
(result: TemplateResult) => {

@@ -62,0 +61,0 @@ const cacheKey = getTemplateCacheKey(result.type, scopeName);

@@ -15,6 +15,2 @@ /**

/**
* @module lit-html
*/
import {TemplateResult} from './template-result.js';

@@ -21,0 +17,0 @@ import {marker, Template} from './template.js';

@@ -15,6 +15,2 @@ /**

/**
* @module lit-html
*/
import {isCEPolyfill} from './dom.js';

@@ -21,0 +17,0 @@ import {Part} from './part.js';

@@ -25,9 +25,18 @@ /**

/**
* Create parts for an attribute-position binding, given the event, attribute
* name, and string literals.
* Create parts for an attribute-position binding, given the element,
* attribute name, and string literals.
*
* @param element The element containing the binding
* @param name The attribute name
* @param strings The string literals. There are always at least two strings,
* event for fully-controlled bindings with a single expression.
* @param name The attribute name, including a possible prefix. The name may
* be prefixed by `.` (for a property binding), `@` (for an event binding)
* or
* `?` (for a boolean attribute binding).
* @param strings The array of literal strings that form the static part of
* the
* attribute value. There are always at least two strings,
* even for fully-controlled bindings with a single expression. For example,
* for the binding `attr="${e1}-${e2}"`, the `strings` array includes three
* strings (`['', '-', '']`)—the text _before_ the first expression (the
* empty string), the text between the two expressions (`'-'`), and the text
* after the last expression (another empty string).
*/

@@ -34,0 +43,0 @@ handleAttributeExpressions(

@@ -23,2 +23,14 @@ /**

declare const trustedTypes: typeof window.trustedTypes;
/**
* Our TrustedTypePolicy for HTML which is declared using the html template
* tag function.
*
* That HTML is a developer-authored constant, and is parsed with innerHTML
* before any untrusted expressions have been mixed in. Therefor it is
* considered safe by construction.
*/
const policy = window.trustedTypes &&
trustedTypes!.createPolicy('lit-html', {createHTML: (s) => s});
const commentMarker = ` ${marker} `;

@@ -104,3 +116,11 @@

const template = document.createElement('template');
template.innerHTML = this.getHTML();
let value = this.getHTML();
if (policy !== undefined) {
// this is secure because `this.strings` is a TemplateStringsArray.
// TODO: validate this when
// https://github.com/tc39/proposal-array-is-template-object is
// implemented.
value = policy.createHTML(value) as unknown as string;
}
template.innerHTML = value;
return template;

@@ -107,0 +127,0 @@ }

@@ -15,6 +15,2 @@ /**

/**
* @module lit-html
*/
import {TemplateResult} from './template-result.js';

@@ -21,0 +17,0 @@

@@ -25,4 +25,3 @@ /**

*
* @module lit-html
* @preferred
* @packageDocumentation
*/

@@ -61,3 +60,3 @@

if (typeof window !== 'undefined') {
(window['litHtmlVersions'] || (window['litHtmlVersions'] = [])).push('1.2.1');
(window['litHtmlVersions'] || (window['litHtmlVersions'] = [])).push('1.3.0-pre.1');
}

@@ -64,0 +63,0 @@

@@ -14,5 +14,2 @@ /**

*/
/**
* @module lit-html
*/
import { Part } from './part.js';

@@ -19,0 +16,0 @@ import { NodePart } from './parts.js';

@@ -14,5 +14,2 @@ /**

*/
/**
* @module lit-html
*/
import { Part } from './part.js';

@@ -19,0 +16,0 @@ export declare type DirectiveFactory = (...args: any[]) => object;

@@ -14,5 +14,2 @@ /**

*/
/**
* @module shady-render
*/
import { Template } from './template.js';

@@ -19,0 +16,0 @@ /**

@@ -15,5 +15,2 @@ /**

/**
* @module lit-html
*/
/**
* The Part interface represents a dynamic part of a template instance rendered

@@ -20,0 +17,0 @@ * by lit-html.

@@ -14,5 +14,2 @@ /**

*/
/**
* @module lit-html
*/
import { TemplateFactory } from './template-factory.js';

@@ -19,0 +16,0 @@ export interface RenderOptions {

@@ -15,3 +15,10 @@ /**

import { RenderOptions } from './render-options.js';
import { TemplateResult } from './template-result.js';
import { Template } from './template.js';
export { html, svg, TemplateResult } from '../lit-html.js';
/**
* Template factory which scopes template DOM using ShadyCSS.
* @param scopeName {string}
*/
export declare const shadyTemplateFactory: (scopeName: string) => (result: TemplateResult) => Template;
export interface ShadyRenderOptions extends Partial<RenderOptions> {

@@ -18,0 +25,0 @@ scopeName: string;

@@ -14,5 +14,2 @@ /**

*/
/**
* @module lit-html
*/
import { TemplateResult } from './template-result.js';

@@ -19,0 +16,0 @@ import { Template } from './template.js';

@@ -22,9 +22,18 @@ /**

/**
* Create parts for an attribute-position binding, given the event, attribute
* name, and string literals.
* Create parts for an attribute-position binding, given the element,
* attribute name, and string literals.
*
* @param element The element containing the binding
* @param name The attribute name
* @param strings The string literals. There are always at least two strings,
* event for fully-controlled bindings with a single expression.
* @param name The attribute name, including a possible prefix. The name may
* be prefixed by `.` (for a property binding), `@` (for an event binding)
* or
* `?` (for a boolean attribute binding).
* @param strings The array of literal strings that form the static part of
* the
* attribute value. There are always at least two strings,
* even for fully-controlled bindings with a single expression. For example,
* for the binding `attr="${e1}-${e2}"`, the `strings` array includes three
* strings (`['', '-', '']`)—the text _before_ the first expression (the
* empty string), the text between the two expressions (`'-'`), and the text
* after the last expression (another empty string).
*/

@@ -31,0 +40,0 @@ handleAttributeExpressions(element: Element, name: string, strings: ReadonlyArray<string>, options: RenderOptions): ReadonlyArray<Part>;

@@ -14,5 +14,2 @@ /**

*/
/**
* @module lit-html
*/
import { TemplateResult } from './template-result.js';

@@ -19,0 +16,0 @@ /**

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

/// <reference types="chai" />
declare const assert: Chai.AssertStatic;
export {};
//# sourceMappingURL=template_polyfill_test.d.ts.map

@@ -14,5 +14,2 @@ /**

*/
/**
* @module lit-html
*/
import { Part } from './part.js';

@@ -19,0 +16,0 @@ import { NodePart } from './parts.js';

@@ -14,5 +14,2 @@ /**

*/
/**
* @module lit-html
*/
import { Part } from './part.js';

@@ -19,0 +16,0 @@ export declare type DirectiveFactory = (...args: any[]) => object;

@@ -14,5 +14,2 @@ /**

*/
/**
* @module shady-render
*/
import { Template } from './template.js';

@@ -19,0 +16,0 @@ /**

@@ -15,5 +15,2 @@ /**

/**
* @module lit-html
*/
/**
* The Part interface represents a dynamic part of a template instance rendered

@@ -20,0 +17,0 @@ * by lit-html.

@@ -14,5 +14,2 @@ /**

*/
/**
* @module lit-html
*/
import { TemplateFactory } from './template-factory.js';

@@ -19,0 +16,0 @@ export interface RenderOptions {

@@ -15,3 +15,10 @@ /**

import { RenderOptions } from './render-options.js';
import { TemplateResult } from './template-result.js';
import { Template } from './template.js';
export { html, svg, TemplateResult } from '../lit-html.js';
/**
* Template factory which scopes template DOM using ShadyCSS.
* @param scopeName {string}
*/
export declare const shadyTemplateFactory: (scopeName: string) => (result: TemplateResult) => Template;
export interface ShadyRenderOptions extends Partial<RenderOptions> {

@@ -18,0 +25,0 @@ scopeName: string;

@@ -14,5 +14,2 @@ /**

*/
/**
* @module lit-html
*/
import { TemplateResult } from './template-result.js';

@@ -19,0 +16,0 @@ import { Template } from './template.js';

@@ -22,9 +22,18 @@ /**

/**
* Create parts for an attribute-position binding, given the event, attribute
* name, and string literals.
* Create parts for an attribute-position binding, given the element,
* attribute name, and string literals.
*
* @param element The element containing the binding
* @param name The attribute name
* @param strings The string literals. There are always at least two strings,
* event for fully-controlled bindings with a single expression.
* @param name The attribute name, including a possible prefix. The name may
* be prefixed by `.` (for a property binding), `@` (for an event binding)
* or
* `?` (for a boolean attribute binding).
* @param strings The array of literal strings that form the static part of
* the
* attribute value. There are always at least two strings,
* even for fully-controlled bindings with a single expression. For example,
* for the binding `attr="${e1}-${e2}"`, the `strings` array includes three
* strings (`['', '-', '']`)—the text _before_ the first expression (the
* empty string), the text between the two expressions (`'-'`), and the text
* after the last expression (another empty string).
*/

@@ -31,0 +40,0 @@ handleAttributeExpressions(element: Element, name: string, strings: ReadonlyArray<string>, options: RenderOptions): ReadonlyArray<Part>;

@@ -14,5 +14,2 @@ /**

*/
/**
* @module lit-html
*/
import { TemplateResult } from './template-result.js';

@@ -19,0 +16,0 @@ /**

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

/// <reference types="chai" />
declare const assert: Chai.AssertStatic;
export {};
//# sourceMappingURL=template_polyfill_test.d.ts.map

@@ -14,5 +14,2 @@ /**

*/
/**
* @module lit-html
*/
import { Part } from './part.js';

@@ -19,0 +16,0 @@ import { NodePart } from './parts.js';

@@ -14,5 +14,2 @@ /**

*/
/**
* @module lit-html
*/
import { Part } from './part.js';

@@ -19,0 +16,0 @@ export declare type DirectiveFactory = (...args: any[]) => object;

@@ -14,5 +14,2 @@ /**

*/
/**
* @module shady-render
*/
import { Template } from './template.js';

@@ -19,0 +16,0 @@ /**

@@ -15,5 +15,2 @@ /**

/**
* @module lit-html
*/
/**
* The Part interface represents a dynamic part of a template instance rendered

@@ -20,0 +17,0 @@ * by lit-html.

@@ -14,5 +14,2 @@ /**

*/
/**
* @module lit-html
*/
import { TemplateFactory } from './template-factory.js';

@@ -19,0 +16,0 @@ export interface RenderOptions {

@@ -15,3 +15,10 @@ /**

import { RenderOptions } from './render-options.js';
import { TemplateResult } from './template-result.js';
import { Template } from './template.js';
export { html, svg, TemplateResult } from '../lit-html.js';
/**
* Template factory which scopes template DOM using ShadyCSS.
* @param scopeName {string}
*/
export declare const shadyTemplateFactory: (scopeName: string) => (result: TemplateResult) => Template;
export interface ShadyRenderOptions extends Partial<RenderOptions> {

@@ -18,0 +25,0 @@ scopeName: string;

@@ -14,5 +14,2 @@ /**

*/
/**
* @module lit-html
*/
import { TemplateResult } from './template-result.js';

@@ -19,0 +16,0 @@ import { Template } from './template.js';

@@ -22,9 +22,18 @@ /**

/**
* Create parts for an attribute-position binding, given the event, attribute
* name, and string literals.
* Create parts for an attribute-position binding, given the element,
* attribute name, and string literals.
*
* @param element The element containing the binding
* @param name The attribute name
* @param strings The string literals. There are always at least two strings,
* event for fully-controlled bindings with a single expression.
* @param name The attribute name, including a possible prefix. The name may
* be prefixed by `.` (for a property binding), `@` (for an event binding)
* or
* `?` (for a boolean attribute binding).
* @param strings The array of literal strings that form the static part of
* the
* attribute value. There are always at least two strings,
* even for fully-controlled bindings with a single expression. For example,
* for the binding `attr="${e1}-${e2}"`, the `strings` array includes three
* strings (`['', '-', '']`)—the text _before_ the first expression (the
* empty string), the text between the two expressions (`'-'`), and the text
* after the last expression (another empty string).
*/

@@ -31,0 +40,0 @@ handleAttributeExpressions(element: Element, name: string, strings: ReadonlyArray<string>, options: RenderOptions): ReadonlyArray<Part>;

@@ -14,5 +14,2 @@ /**

*/
/**
* @module lit-html
*/
import { TemplateResult } from './template-result.js';

@@ -19,0 +16,0 @@ /**

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

/// <reference types="chai" />
declare const assert: Chai.AssertStatic;
export {};
//# sourceMappingURL=template_polyfill_test.d.ts.map

@@ -14,5 +14,2 @@ /**

*/
/**
* @module lit-html
*/
import { Part } from './part.js';

@@ -19,0 +16,0 @@ import { NodePart } from './parts.js';

@@ -14,5 +14,2 @@ /**

*/
/**
* @module lit-html
*/
import { Part } from './part.js';

@@ -19,0 +16,0 @@ export declare type DirectiveFactory = (...args: any[]) => object;

@@ -14,5 +14,2 @@ /**

*/
/**
* @module shady-render
*/
import { Template } from './template.js';

@@ -19,0 +16,0 @@ /**

@@ -15,5 +15,2 @@ /**

/**
* @module lit-html
*/
/**
* The Part interface represents a dynamic part of a template instance rendered

@@ -20,0 +17,0 @@ * by lit-html.

@@ -14,5 +14,2 @@ /**

*/
/**
* @module lit-html
*/
import { TemplateFactory } from './template-factory.js';

@@ -19,0 +16,0 @@ export interface RenderOptions {

@@ -15,3 +15,10 @@ /**

import { RenderOptions } from './render-options.js';
import { TemplateResult } from './template-result.js';
import { Template } from './template.js';
export { html, svg, TemplateResult } from '../lit-html.js';
/**
* Template factory which scopes template DOM using ShadyCSS.
* @param scopeName {string}
*/
export declare const shadyTemplateFactory: (scopeName: string) => (result: TemplateResult) => Template;
export interface ShadyRenderOptions extends Partial<RenderOptions> {

@@ -18,0 +25,0 @@ scopeName: string;

@@ -14,5 +14,2 @@ /**

*/
/**
* @module lit-html
*/
import { TemplateResult } from './template-result.js';

@@ -19,0 +16,0 @@ import { Template } from './template.js';

@@ -22,9 +22,18 @@ /**

/**
* Create parts for an attribute-position binding, given the event, attribute
* name, and string literals.
* Create parts for an attribute-position binding, given the element,
* attribute name, and string literals.
*
* @param element The element containing the binding
* @param name The attribute name
* @param strings The string literals. There are always at least two strings,
* event for fully-controlled bindings with a single expression.
* @param name The attribute name, including a possible prefix. The name may
* be prefixed by `.` (for a property binding), `@` (for an event binding)
* or
* `?` (for a boolean attribute binding).
* @param strings The array of literal strings that form the static part of
* the
* attribute value. There are always at least two strings,
* even for fully-controlled bindings with a single expression. For example,
* for the binding `attr="${e1}-${e2}"`, the `strings` array includes three
* strings (`['', '-', '']`)—the text _before_ the first expression (the
* empty string), the text between the two expressions (`'-'`), and the text
* after the last expression (another empty string).
*/

@@ -31,0 +40,0 @@ handleAttributeExpressions(element: Element, name: string, strings: ReadonlyArray<string>, options: RenderOptions): ReadonlyArray<Part>;

@@ -14,5 +14,2 @@ /**

*/
/**
* @module lit-html
*/
import { TemplateResult } from './template-result.js';

@@ -19,0 +16,0 @@ /**

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

/// <reference types="chai" />
declare const assert: Chai.AssertStatic;
export {};
//# sourceMappingURL=template_polyfill_test.d.ts.map

@@ -6,3 +6,3 @@ {

"lib": ["es2017", "esnext.asynciterable", "dom"],
"types": ["chai", "mocha"],
"types": ["chai", "mocha", "trusted-types"],
"declaration": true,

@@ -9,0 +9,0 @@ "declarationMap": true,

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc