mirror of
https://github.com/jlengrand/open-wc.git
synced 2026-03-10 08:31:19 +00:00
feat: add typescript type declaration files
This commit is contained in:
committed by
Thomas Allmer
parent
e736ead77c
commit
f5cb24399d
4
packages/chai-dom-equals/chai-dom-equals.d.ts
vendored
Normal file
4
packages/chai-dom-equals/chai-dom-equals.d.ts
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
import * as Chai from 'chai'
|
||||
export function getOuterHtml(el: Element): string;
|
||||
export function getCleanedShadowDom(el: Element): string;
|
||||
export function chaiDomEquals(chai: Chai, utils: any): undefined;
|
||||
1
packages/chai-dom-equals/index.d.ts
vendored
Normal file
1
packages/chai-dom-equals/index.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export { getOuterHtml, getCleanedShadowDom, chaiDomEquals } from './chai-dom-equals';
|
||||
@@ -14,7 +14,8 @@
|
||||
"test:es5:bs": "karma start karma.es5.bs.config.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@open-wc/semantic-dom-diff": "^0.4.3"
|
||||
"@open-wc/semantic-dom-diff": "^0.4.3",
|
||||
"@types/chai": "^4.1.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@bundled-es-modules/chai": "^4.2.0",
|
||||
|
||||
1
packages/semantic-dom-diff/index.d.ts
vendored
Normal file
1
packages/semantic-dom-diff/index.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export { getSemanticDomDiff, getAST } from './src/get-dom-diff';
|
||||
@@ -15,7 +15,8 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@bundled-es-modules/deep-diff": "^1.0.2-rc.1",
|
||||
"@bundled-es-modules/parse5": "^5.1.0"
|
||||
"@bundled-es-modules/parse5": "^5.1.0",
|
||||
"@types/parse5": "^5.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@bundled-es-modules/chai": "^4.2.0",
|
||||
|
||||
11
packages/semantic-dom-diff/src/get-dom-diff.d.ts
vendored
Normal file
11
packages/semantic-dom-diff/src/get-dom-diff.d.ts
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
import { DocumentFragment } from 'parse5';
|
||||
|
||||
interface DiffResult {
|
||||
message: String;
|
||||
path: String;
|
||||
normalizedLeftHTML: String;
|
||||
normalizedRightHTML: String;
|
||||
}
|
||||
|
||||
export function getAST(value, config): DocumentFragment
|
||||
export function getSemanticDomDiff(leftHTML, rightHTML, config): DiffResult
|
||||
21
packages/storybook/index.d.ts
vendored
Normal file
21
packages/storybook/index.d.ts
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
export { html } from 'lit-html';
|
||||
|
||||
// NB: @types/storybook__polymer doesn't yet exist
|
||||
// export { storiesOf, addParameters } from '@storybook/polymer';
|
||||
export { action } from '@storybook/addon-actions';
|
||||
export { linkTo } from '@storybook/addon-links';
|
||||
// NB: @types/storybook__addon-backgrounds is 2 major versions behind
|
||||
// export { withBackgrounds } from '@storybook/addon-backgrounds';
|
||||
export { withNotes } from '@storybook/addon-notes';
|
||||
|
||||
export {
|
||||
withKnobs,
|
||||
text,
|
||||
button,
|
||||
number,
|
||||
select,
|
||||
date,
|
||||
color,
|
||||
array,
|
||||
boolean,
|
||||
} from '@storybook/addon-knobs';
|
||||
@@ -22,6 +22,11 @@
|
||||
"@storybook/addon-storysource": "^4.0.0-alpha.25",
|
||||
"@storybook/addon-viewport": "^4.0.0-alpha.25",
|
||||
"@storybook/polymer": "^4.0.0-alpha.25",
|
||||
"@types/storybook__addon-actions": "^3.4.1",
|
||||
"@types/storybook__addon-backgrounds": "^3.2.1",
|
||||
"@types/storybook__addon-knobs": "^3.4.1",
|
||||
"@types/storybook__addon-links": "^3.3.3",
|
||||
"@types/storybook__addon-notes": "^3.3.3",
|
||||
"@webcomponents/webcomponentsjs": "^2.0.0",
|
||||
"babel-loader": "^8.0.0",
|
||||
"moment": "^2.0.0",
|
||||
|
||||
5
packages/testing-helpers/fixture.d.ts
vendored
Normal file
5
packages/testing-helpers/fixture.d.ts
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
type PropsFunction = (element: HTMLElement) => Object;
|
||||
type FixtureProps = Object | PropsFunction;
|
||||
export class FixtureWrapper extends HTMLElement { };
|
||||
export function fixtureSync(template: string, props: FixtureProps): FixtureWrapper;
|
||||
export async function fixture(template: string, setup: FixtureProps): FixtureWrapper;
|
||||
10
packages/testing-helpers/helpers.d.ts
vendored
Normal file
10
packages/testing-helpers/helpers.d.ts
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
type Constructor<T = {}> = new (...args: any[]) => T;
|
||||
|
||||
export function defineCE<TBase extends Constructor>(klass: TBase): string;
|
||||
export function isIE(): boolean
|
||||
export async function aTimeout(ms: int): void
|
||||
export async function triggerBlurFor(element: HTMLElement): void
|
||||
export async function triggerFocusFor(element: HTMLElement): void
|
||||
export async function oneEvent(element: HTMLElement, eventName: string): Event
|
||||
export async function nextFrame(): void
|
||||
export async function flush(): void
|
||||
12
packages/testing-helpers/index.d.ts
vendored
Normal file
12
packages/testing-helpers/index.d.ts
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
export { html, unsafeStatic } from './lit-html';
|
||||
export {
|
||||
aTimeout,
|
||||
defineCE,
|
||||
isIE,
|
||||
nextFrame,
|
||||
oneEvent,
|
||||
triggerBlurFor,
|
||||
triggerFocusFor,
|
||||
} from './helpers';
|
||||
export { litFixture, litFixtureSync } from './litFixture';
|
||||
export { fixture, fixtureSync } from './fixture';
|
||||
2
packages/testing-helpers/lit-html.d.ts
vendored
Normal file
2
packages/testing-helpers/lit-html.d.ts
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
export { render, html } from 'lit-html/lit-html';
|
||||
export function unsafeStatic<TOptions>(options: TOptions): { d: TOptions }
|
||||
4
packages/testing-helpers/litFixture.d.ts
vendored
Normal file
4
packages/testing-helpers/litFixture.d.ts
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
import { FixtureWrapper } from './fixture';
|
||||
|
||||
export function litFixtureSync(template: TemplateResult): FixtureWrapper;
|
||||
export async function litFixture(template: TemplateResult): FixtureWrapper;
|
||||
22
packages/testing/index.d.ts
vendored
Normal file
22
packages/testing/index.d.ts
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
export {
|
||||
html,
|
||||
unsafeStatic,
|
||||
triggerBlurFor,
|
||||
triggerFocusFor,
|
||||
oneEvent,
|
||||
isIE,
|
||||
defineCE,
|
||||
aTimeout,
|
||||
litFixture,
|
||||
litFixtureSync,
|
||||
fixture,
|
||||
fixtureSync,
|
||||
} from '@open-wc/testing-helpers';
|
||||
|
||||
export {
|
||||
expect,
|
||||
should,
|
||||
assert,
|
||||
} from 'chai';
|
||||
|
||||
import 'chai';
|
||||
@@ -17,6 +17,7 @@
|
||||
"@bundled-es-modules/chai": "^4.2.0",
|
||||
"@open-wc/chai-dom-equals": "^0.5.3",
|
||||
"@open-wc/testing-helpers": "^0.4.3",
|
||||
"@types/chai": "^4.1.7",
|
||||
"mocha": "^5.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
Reference in New Issue
Block a user