@mgdis/stencil-helpers 3.2.0 → 3.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/index.d.ts +1 -205
- package/dist/components/index.d.ts.map +1 -1
- package/dist/ide/index.d.ts +1 -108
- package/dist/ide/index.d.ts.map +1 -1
- package/dist/index.es.js +702 -623
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +17 -20
- package/dist/index.umd.js.map +1 -1
- package/dist/locale/index.d.ts +2 -116
- package/dist/locale/index.d.ts.map +1 -1
- package/dist/storybook/index.d.ts +1 -76
- package/dist/storybook/index.d.ts.map +1 -1
- package/dist/tests/index.d.ts +1 -1
- package/dist/tests/index.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -4
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +14 -15
- package/dist/storybook/index.conf.d.ts +0 -7
- package/dist/storybook/index.conf.d.ts.map +0 -1
- package/dist/tests/unit.conf.d.ts +0 -16
- package/dist/tests/unit.conf.d.ts.map +0 -1
- package/dist/tests/unit.d.ts +0 -76
- package/dist/tests/unit.d.ts.map +0 -1
package/dist/locale/index.d.ts
CHANGED
|
@@ -1,117 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* Gets the date pattern based on the specified locale.
|
|
4
|
-
* @param locale - the locale to refer to
|
|
5
|
-
* @returns date pattern
|
|
6
|
-
* @example
|
|
7
|
-
* ```ts
|
|
8
|
-
* getLocaleDatePattern('fr') // 'dd/mm/yyyy'
|
|
9
|
-
* ```
|
|
10
|
-
*/
|
|
11
|
-
export declare const getLocaleDatePattern: (locale: string) => string;
|
|
12
|
-
/**
|
|
13
|
-
* Formats a date object to a string with the pattern 'YYYY-MM-DD'.
|
|
14
|
-
* @param date - date to parse
|
|
15
|
-
* @returns string date with pattern 'YYYY-MM-DD'
|
|
16
|
-
* @example
|
|
17
|
-
* ```ts
|
|
18
|
-
* dateToString(new Date('2023-12-24')) // '2023-12-24'
|
|
19
|
-
* ```
|
|
20
|
-
*/
|
|
21
|
-
export declare const dateToString: (date: Date) => string | undefined;
|
|
22
|
-
/**
|
|
23
|
-
* Format number to the locale currency
|
|
24
|
-
* @param number - number to format
|
|
25
|
-
* @param locale - locale to apply
|
|
26
|
-
* @param currency - currency to apply
|
|
27
|
-
* @returns formatted currency
|
|
28
|
-
* @example
|
|
29
|
-
* ```ts
|
|
30
|
-
* localeCurrency(1234567890.12, 'fr', 'EUR') // '1 234 567 890,12\xa0€'
|
|
31
|
-
* ```
|
|
32
|
-
*/
|
|
33
|
-
export declare const localeCurrency: (number: number, locale: string, currency: string) => string;
|
|
34
|
-
/**
|
|
35
|
-
* Format number to locale
|
|
36
|
-
* @param number - number to format
|
|
37
|
-
* @param locale - locale to apply
|
|
38
|
-
* @param decimalLength - decimal length to apply
|
|
39
|
-
* @returns formatted number
|
|
40
|
-
* @example
|
|
41
|
-
* ```ts
|
|
42
|
-
* localeNumber(1234567890.12, 'fr') // 1 234 567 890,12
|
|
43
|
-
* ```
|
|
44
|
-
*/
|
|
45
|
-
export declare const localeNumber: (number: number, locale: string, decimalLength?: number) => string;
|
|
46
|
-
/**
|
|
47
|
-
* Format number as percentage based on locale
|
|
48
|
-
* @param number - number to format
|
|
49
|
-
* @param locale - locale to apply
|
|
50
|
-
* @param decimalLength - decimal length to apply
|
|
51
|
-
* @returns formatted percentage
|
|
52
|
-
* @example
|
|
53
|
-
* ```ts
|
|
54
|
-
* localePercent(0.42, 'fr', 2) // '42,00 %'
|
|
55
|
-
* localePercent(0.42, 'en', 2) // '42.00%'
|
|
56
|
-
* ```
|
|
57
|
-
*/
|
|
58
|
-
export declare const localePercent: (number: number, locale: string, decimalLength?: number) => string;
|
|
59
|
-
/**
|
|
60
|
-
* Format number with standardized unit based on locale using Intl unit formatting
|
|
61
|
-
* @param number - number to format
|
|
62
|
-
* @param locale - locale to apply
|
|
63
|
-
* @param unit - standardized unit (e.g., 'kilometer', 'kilogram', 'celsius')
|
|
64
|
-
* @param unitDisplay - how to display the unit ('short', 'long', 'narrow')
|
|
65
|
-
* @param decimalLength - decimal length to apply
|
|
66
|
-
* @returns formatted number with localized unit
|
|
67
|
-
* @example
|
|
68
|
-
* ```ts
|
|
69
|
-
* localeUnit(1234567890.12, 'fr', 'kilometer') // '1 234 567 890,12 km'
|
|
70
|
-
* localeUnit(23, 'fr', 'celsius') // '23 °C'
|
|
71
|
-
* localeUnit(10, 'fr', 'kilometer', 0, 'long') // '10 kilomètres'
|
|
72
|
-
* ```
|
|
73
|
-
*/
|
|
74
|
-
export declare const localeUnit: (number: number, locale: string, unit: Intl.NumberFormatOptions["unit"], unitDisplay?: Intl.NumberFormatOptions["unitDisplay"], decimalLength?: number) => string;
|
|
75
|
-
/**
|
|
76
|
-
* Date RegExp, usefull to test if string is a follow the date pattern
|
|
77
|
-
* @example
|
|
78
|
-
* ```ts
|
|
79
|
-
* dateRegExp.test('mystring') // false
|
|
80
|
-
* dateRegExp.test('2020-12-31') // true
|
|
81
|
-
* ```
|
|
82
|
-
*/
|
|
83
|
-
export declare const dateRegExp: RegExp;
|
|
84
|
-
/**
|
|
85
|
-
* Locale date format
|
|
86
|
-
* @param date - date to format
|
|
87
|
-
* @param locale - locale to apply
|
|
88
|
-
* @param config - DateTimeFormatOptions object to apply
|
|
89
|
-
* @returns formatted date
|
|
90
|
-
* @example
|
|
91
|
-
* ```ts
|
|
92
|
-
* localeDate('2022-06-02', 'fr') // '02/06/2022'
|
|
93
|
-
* ```
|
|
94
|
-
*/
|
|
95
|
-
export declare const localeDate: (date: string | undefined, locale: string, config?: Intl.DateTimeFormatOptions) => string;
|
|
96
|
-
/**
|
|
97
|
-
* Get Intl object
|
|
98
|
-
* @param messages - locales to render in object format. `ex: { en: { porp: "test" }, fr: { porp: "test" }}`.
|
|
99
|
-
* @param defaultLocale - fallback locale to render. `ex: 'en'`.
|
|
100
|
-
* @returns from the element passed in return function you will get the matching messages object
|
|
101
|
-
* @example
|
|
102
|
-
* ```ts
|
|
103
|
-
* import en from './en/messages.json';
|
|
104
|
-
* import fr from './fr/messages.json';
|
|
105
|
-
* import { defineLocales } from '@mgdis/stencil-helpers';
|
|
106
|
-
*
|
|
107
|
-
* const defaultLocale = 'en';
|
|
108
|
-
* const messages = { en, fr };
|
|
109
|
-
*
|
|
110
|
-
* export const initLocales = defineLocales(messages, defaultLocale);
|
|
111
|
-
* ```
|
|
112
|
-
*/
|
|
113
|
-
export declare const defineLocales: (messages: ObjectType, defaultLocale: "fr" | "en" | string) => (element: HTMLElement) => {
|
|
114
|
-
locale: string;
|
|
115
|
-
messages: ObjectType;
|
|
116
|
-
};
|
|
1
|
+
export { localeDatePattern as getLocaleDatePattern, localeCurrency, localeNumber, localePercent, localeUnit, localeDate, defineLocales } from '@mgdis/core-ui-helpers/dist/locale';
|
|
2
|
+
export { dateToString, dateRegExp } from '@mgdis/core-ui-helpers/dist/utils';
|
|
117
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/locale/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/locale/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,IAAI,oBAAoB,EAAE,cAAc,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AAEnL,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC"}
|
|
@@ -1,77 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import { ArgsType } from './index.conf';
|
|
3
|
-
import { JsonDocs } from '@stencil/core/internal';
|
|
4
|
-
/**
|
|
5
|
-
* Filter default argument on component argument to prevent them to be rendered
|
|
6
|
-
* @param args - all possible args with custom values
|
|
7
|
-
* @param defaultValues - component default args values
|
|
8
|
-
* @param slots - slots
|
|
9
|
-
* @returns filtres args
|
|
10
|
-
* @example
|
|
11
|
-
* ```ts
|
|
12
|
-
* import { filterArgs } from '@mgdis/stencil-helpers';
|
|
13
|
-
* const Template = (args: MgBadgeType): HTMLElement => <mg-badge {...filterArgs(args, { variant: 'info' }, ['actions'])}></mg-badge>;
|
|
14
|
-
* ```
|
|
15
|
-
*/
|
|
16
|
-
export declare const filterArgs: <T>(args: T, defaultValues?: Partial<T>, slots?: string[]) => T;
|
|
17
|
-
/**
|
|
18
|
-
* Storybook stencil wrapper. Used to target element with `storybook-root` id and render virtual DOM inside.
|
|
19
|
-
* @param storyFn - storybook render function
|
|
20
|
-
* @param context - storybook context
|
|
21
|
-
* @returns rendered element
|
|
22
|
-
* @example
|
|
23
|
-
* ```ts
|
|
24
|
-
* // .storybook/preview.ts
|
|
25
|
-
* import { stencilWrapper } from '@mgdis/stencil-helpers';
|
|
26
|
-
* export const decorators: Preview['decorators'] = [stencilWrapper];
|
|
27
|
-
* ```
|
|
28
|
-
*/
|
|
29
|
-
export declare const stencilWrapper: (storyFn: (ctx: any) => void, context: ArgsType) => Element | undefined;
|
|
30
|
-
/**
|
|
31
|
-
* Get story HTML from virtual DOM.
|
|
32
|
-
* Mainly used to render, component code exemple in stories.
|
|
33
|
-
* @param vitualNode - story virtual DOM
|
|
34
|
-
* @returns stringified rendered HTML
|
|
35
|
-
* @example
|
|
36
|
-
* ```ts
|
|
37
|
-
* // .storybook/preview.ts
|
|
38
|
-
* import { getStoryHTML } from '@mgdis/stencil-helpers';
|
|
39
|
-
*
|
|
40
|
-
* export const parameters: Preview['parameters'] = {
|
|
41
|
-
* docs: {
|
|
42
|
-
* source: {
|
|
43
|
-
* transform: (_, ctx) => getStoryHTML(ctx.originalStoryFn(ctx.args)),
|
|
44
|
-
* }
|
|
45
|
-
* },
|
|
46
|
-
* };
|
|
47
|
-
* ```
|
|
48
|
-
*/
|
|
49
|
-
export declare const getStoryHTML: ({ $tag$, $attrs$, $children$, $text$ }: VNode) => string;
|
|
50
|
-
/**
|
|
51
|
-
* Retrieve Component Storybook URL from file path
|
|
52
|
-
* @param storybookBaseUrl - Storybook Base URL
|
|
53
|
-
* @param filePath - Component file path
|
|
54
|
-
* @returns Component Storybook URL
|
|
55
|
-
*/
|
|
56
|
-
export declare const getStorybookUrl: (storybookBaseUrl: string, filePath: string | undefined) => string | undefined;
|
|
57
|
-
export declare class StorybookPreview {
|
|
58
|
-
#private;
|
|
59
|
-
/**
|
|
60
|
-
* JsonDocs
|
|
61
|
-
*/
|
|
62
|
-
jsonDoc: JsonDocs;
|
|
63
|
-
constructor(jsonDoc: JsonDocs);
|
|
64
|
-
/**
|
|
65
|
-
* Extract component arg types from the component data
|
|
66
|
-
* @param tagName - tag name we want to extract the arg types from
|
|
67
|
-
* @returns component arg types
|
|
68
|
-
*/
|
|
69
|
-
extractArgTypes: (tagName: string) => {};
|
|
70
|
-
/**
|
|
71
|
-
* Extract component description from the component data
|
|
72
|
-
* @param tagName - tag name we want to extract the description from
|
|
73
|
-
* @returns component description
|
|
74
|
-
*/
|
|
75
|
-
extractComponentDescription: (tagName: string) => string | undefined;
|
|
76
|
-
}
|
|
1
|
+
export { filterArgs, stencilWrapper, getStoryHTML, getStorybookUrl, StorybookPreview } from '@mgdis/core-ui-helpers/dist/storybook';
|
|
77
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/storybook/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/storybook/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC"}
|
package/dist/tests/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { setupMutationObserverMock, setupResizeObserverMock, setupSubmitEventMock, setUpRequestAnimationFrameMock } from '@mgdis/core-ui-helpers/dist/tests';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tests/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tests/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,8BAA8B,EAAE,MAAM,mCAAmC,CAAC"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,mCAAmC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mgdis/stencil-helpers",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.2",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"author": "Nicolas Jouanno <jouanno-n@mgdis.fr>",
|
|
6
6
|
"maintainers": [
|
|
@@ -21,22 +21,21 @@
|
|
|
21
21
|
}
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@
|
|
25
|
-
"@mgdis/mg-components-helpers": "4.2.0"
|
|
24
|
+
"@mgdis/core-ui-helpers": "1.0.1"
|
|
26
25
|
},
|
|
27
26
|
"devDependencies": {
|
|
28
|
-
"@types/node": "22.15.
|
|
29
|
-
"@vitest/coverage-istanbul": "3.
|
|
30
|
-
"@vitest/coverage-v8": "3.
|
|
31
|
-
"htmlfy": "0.7.
|
|
32
|
-
"typedoc": "0.28.
|
|
33
|
-
"typedoc-plugin-markdown": "4.6.
|
|
34
|
-
"vite": "6.3.
|
|
35
|
-
"vite-plugin-dts": "4.5.
|
|
36
|
-
"vitest": "3.
|
|
37
|
-
"@core-ui/tsconfig": "1.0.
|
|
38
|
-
"@core-ui/
|
|
39
|
-
"@core-ui/
|
|
27
|
+
"@types/node": "22.15.31",
|
|
28
|
+
"@vitest/coverage-istanbul": "3.2.3",
|
|
29
|
+
"@vitest/coverage-v8": "3.2.3",
|
|
30
|
+
"htmlfy": "0.7.5",
|
|
31
|
+
"typedoc": "0.28.5",
|
|
32
|
+
"typedoc-plugin-markdown": "4.6.4",
|
|
33
|
+
"vite": "6.3.5",
|
|
34
|
+
"vite-plugin-dts": "4.5.4",
|
|
35
|
+
"vitest": "3.2.3",
|
|
36
|
+
"@core-ui/tsconfig": "1.0.8",
|
|
37
|
+
"@core-ui/vitest-config": "1.0.5",
|
|
38
|
+
"@core-ui/typedoc-config": "1.0.2"
|
|
40
39
|
},
|
|
41
40
|
"scripts": {
|
|
42
41
|
"build": "vite build",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.conf.d.ts","sourceRoot":"","sources":["../../src/storybook/index.conf.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG;IAAE,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Define MutationObserver setup function signature
|
|
3
|
-
*/
|
|
4
|
-
export type SetupMutationObserverMockParams = {
|
|
5
|
-
disconnect: MutationObserver['disconnect'];
|
|
6
|
-
observe: MutationObserver['observe'];
|
|
7
|
-
takeRecords: MutationObserver['takeRecords'];
|
|
8
|
-
};
|
|
9
|
-
/**
|
|
10
|
-
* Define ResizeObserver setup function signature
|
|
11
|
-
*/
|
|
12
|
-
export type setupResizeObserverMockParams = {
|
|
13
|
-
disconnect: ResizeObserver['disconnect'];
|
|
14
|
-
observe: ResizeObserver['observe'];
|
|
15
|
-
};
|
|
16
|
-
//# sourceMappingURL=unit.conf.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"unit.conf.d.ts","sourceRoot":"","sources":["../../src/tests/unit.conf.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,+BAA+B,GAAG;IAAE,UAAU,EAAE,gBAAgB,CAAC,YAAY,CAAC,CAAC;IAAC,OAAO,EAAE,gBAAgB,CAAC,SAAS,CAAC,CAAC;IAAC,WAAW,EAAE,gBAAgB,CAAC,aAAa,CAAC,CAAA;CAAE,CAAC;AAEjL;;GAEG;AACH,MAAM,MAAM,6BAA6B,GAAG;IAAE,UAAU,EAAE,cAAc,CAAC,YAAY,CAAC,CAAC;IAAC,OAAO,EAAE,cAAc,CAAC,SAAS,CAAC,CAAA;CAAE,CAAC"}
|
package/dist/tests/unit.d.ts
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { SetupMutationObserverMockParams, setupResizeObserverMockParams } from './unit.conf';
|
|
2
|
-
/**
|
|
3
|
-
* Utility function that mocks the `MutationObserver` API. Recommended to execute inside `beforeEach`.
|
|
4
|
-
* @param mutationObserverMock - Parameter that is sent to the `Object.defineProperty`
|
|
5
|
-
* overwrite method. `jest.fn()` mock functions can be passed here if the goal is to not only
|
|
6
|
-
* mock the mutation observer, but its methods.
|
|
7
|
-
* You can manually fire an intersection entry:
|
|
8
|
-
* @param mutationObserverMock - configuration object
|
|
9
|
-
* @returns Mocked MutationObserver
|
|
10
|
-
* @example
|
|
11
|
-
* ```
|
|
12
|
-
* let fireMo;
|
|
13
|
-
* setupMutationObserverMock({
|
|
14
|
-
* observe: function () {
|
|
15
|
-
* fireMo = this.cb;
|
|
16
|
-
* },
|
|
17
|
-
* });
|
|
18
|
-
* ...
|
|
19
|
-
* fireMo([{ type: 'childList', addedNodes: [AMockElemenet, AnotherMockElemenet], target: yourMockElemenet }]);;
|
|
20
|
-
* ```
|
|
21
|
-
*/
|
|
22
|
-
export declare const setupMutationObserverMock: ({ disconnect, observe, takeRecords }: SetupMutationObserverMockParams) => typeof MutationObserver;
|
|
23
|
-
/**
|
|
24
|
-
* Utility function that mocks the `ResizeObserver` API. Recommended to execute inside `beforeEach`.
|
|
25
|
-
* @param resizeObserverMock - Parameter that is sent to the `Object.defineProperty`
|
|
26
|
-
* overwrite method. `jest.fn()` mock functions can be passed here if the goal is to not only
|
|
27
|
-
* mock the resize observer, but its methods.
|
|
28
|
-
* You can manually fire an intersection entry:
|
|
29
|
-
* @param resizeObserverMock - configuration object
|
|
30
|
-
* @returns Mocked ResizeObserver
|
|
31
|
-
* @example
|
|
32
|
-
* ```
|
|
33
|
-
* let fireRo;
|
|
34
|
-
* setupResizeObserverMock({
|
|
35
|
-
* observe: function () {
|
|
36
|
-
* fireRo = this.cb;
|
|
37
|
-
* },
|
|
38
|
-
* });
|
|
39
|
-
* ...
|
|
40
|
-
* fireRo([{
|
|
41
|
-
* borderBoxSize: ResizeObserverSize[],
|
|
42
|
-
* contentBoxSize: ResizeObserverSize[],
|
|
43
|
-
* contentRect: DOMRectReadOnly,
|
|
44
|
-
* devicePixelContentBoxSize: ResizeObserverSize[],
|
|
45
|
-
* target: yourMockElemenet
|
|
46
|
-
* }]);;
|
|
47
|
-
* ```
|
|
48
|
-
*/
|
|
49
|
-
export declare const setupResizeObserverMock: ({ disconnect, observe }: setupResizeObserverMockParams) => typeof ResizeObserver;
|
|
50
|
-
declare class MockCustomEvent extends Event {
|
|
51
|
-
/**
|
|
52
|
-
*
|
|
53
|
-
*/
|
|
54
|
-
detail: any;
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Utility function that mocks the `SubmitEvent` API. Recommended to execute inside `beforeEach`.
|
|
58
|
-
* @example
|
|
59
|
-
* ```
|
|
60
|
-
* setupSubmitEventMock();
|
|
61
|
-
* ```
|
|
62
|
-
* @returns custom event mock
|
|
63
|
-
*/
|
|
64
|
-
export declare const setupSubmitEventMock: () => typeof MockCustomEvent;
|
|
65
|
-
/**
|
|
66
|
-
* Utility function that mocks the `requestAnimationFrame` API. Recommended to execute inside `test`.
|
|
67
|
-
* @example
|
|
68
|
-
* ```
|
|
69
|
-
* setUpRequestAnimationFrameMock(jest.runOnlyPendingTimers);
|
|
70
|
-
* ```
|
|
71
|
-
* @param faketimer - recommended to use jest.runOnlyPendingTimers()
|
|
72
|
-
* @returns custom setUpRequestAnimationFrameMock mock
|
|
73
|
-
*/
|
|
74
|
-
export declare const setUpRequestAnimationFrameMock: (faketimer: () => void) => (callback: FrameRequestCallback) => number;
|
|
75
|
-
export {};
|
|
76
|
-
//# sourceMappingURL=unit.d.ts.map
|
package/dist/tests/unit.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"unit.d.ts","sourceRoot":"","sources":["../../src/tests/unit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,+BAA+B,EAAE,6BAA6B,EAAE,MAAM,aAAa,CAAC;AAElG;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,yBAAyB,GAAI,sCAAsC,+BAA+B,KAAG,OAAO,gBAgCxH,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,uBAAuB,GAAI,yBAAyB,6BAA6B,KAAG,OAAO,cAgCvG,CAAC;AAEF,cAAM,eAAgB,SAAQ,KAAK;IACjC;;OAEG;IACH,MAAM,EAAE,GAAG,CAAC;CACb;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB,QAAO,OAAO,eAY9C,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,8BAA8B,GAAI,WAAW,MAAM,IAAI,gBACzB,oBAAoB,WAe9D,CAAC"}
|