tsc ask to export type from web-util
This commit is contained in:
parent
dbb3529b49
commit
1ee962fbd8
@ -19,7 +19,6 @@
|
|||||||
* @author Sebastian Javier Marchano (sebasjm)
|
* @author Sebastian Javier Marchano (sebasjm)
|
||||||
*/
|
*/
|
||||||
import { setupI18n } from "@gnu-taler/taler-util";
|
import { setupI18n } from "@gnu-taler/taler-util";
|
||||||
import e from "express";
|
|
||||||
import {
|
import {
|
||||||
ComponentChild,
|
ComponentChild,
|
||||||
ComponentChildren,
|
ComponentChildren,
|
||||||
@ -32,6 +31,7 @@ import {
|
|||||||
VNode,
|
VNode,
|
||||||
} from "preact";
|
} from "preact";
|
||||||
import { useEffect, useErrorBoundary, useState } from "preact/hooks";
|
import { useEffect, useErrorBoundary, useState } from "preact/hooks";
|
||||||
|
import { ExampleItemSetup } from "./tests/hook.js";
|
||||||
|
|
||||||
const Page: FunctionalComponent = ({ children }): VNode => {
|
const Page: FunctionalComponent = ({ children }): VNode => {
|
||||||
return (
|
return (
|
||||||
@ -373,12 +373,6 @@ export interface ComponentItem<Props extends object = {}> {
|
|||||||
examples: ExampleItem<Props>[];
|
examples: ExampleItem<Props>[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ExampleItemSetup<Props extends object = {}> = {
|
|
||||||
component: FunctionalComponent<Props>;
|
|
||||||
props: Props;
|
|
||||||
contextProps: object;
|
|
||||||
};
|
|
||||||
|
|
||||||
export interface ExampleItem<Props extends object = {}> {
|
export interface ExampleItem<Props extends object = {}> {
|
||||||
group: string;
|
group: string;
|
||||||
component: string;
|
component: string;
|
||||||
|
@ -24,7 +24,6 @@ import {
|
|||||||
render as renderIntoDom,
|
render as renderIntoDom,
|
||||||
} from "preact";
|
} from "preact";
|
||||||
import { render as renderToString } from "preact-render-to-string";
|
import { render as renderToString } from "preact-render-to-string";
|
||||||
import { ExampleItem, ExampleItemSetup } from "../stories.js";
|
|
||||||
|
|
||||||
// This library is expected to be included in testing environment only
|
// This library is expected to be included in testing environment only
|
||||||
// When doing tests we want the requestAnimationFrame to be as fast as possible.
|
// When doing tests we want the requestAnimationFrame to be as fast as possible.
|
||||||
@ -33,6 +32,12 @@ options.requestAnimationFrame = (fn: () => void) => {
|
|||||||
return fn();
|
return fn();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export type ExampleItemSetup<Props extends object = {}> = {
|
||||||
|
component: FunctionalComponent<Props>;
|
||||||
|
props: Props;
|
||||||
|
contextProps: object;
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param Component component to be tested
|
* @param Component component to be tested
|
||||||
@ -113,10 +118,8 @@ function renderHook(
|
|||||||
type RecursiveState<S> = S | (() => RecursiveState<S>);
|
type RecursiveState<S> = S | (() => RecursiveState<S>);
|
||||||
|
|
||||||
interface Mounted<T> {
|
interface Mounted<T> {
|
||||||
// unmount: () => void;
|
|
||||||
pullLastResultOrThrow: () => Exclude<T, VoidFunction>;
|
pullLastResultOrThrow: () => Exclude<T, VoidFunction>;
|
||||||
assertNoPendingUpdate: () => Promise<boolean>;
|
assertNoPendingUpdate: () => Promise<boolean>;
|
||||||
// waitNextUpdate: (s?: string) => Promise<void>;
|
|
||||||
waitForStateUpdate: () => Promise<boolean>;
|
waitForStateUpdate: () => Promise<boolean>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"composite": true,
|
"composite": true,
|
||||||
|
"declaration": true,
|
||||||
|
"declarationMap": false,
|
||||||
"target": "ES6",
|
"target": "ES6",
|
||||||
"module": "ESNext",
|
"module": "ESNext",
|
||||||
"jsx": "react",
|
"jsx": "react",
|
||||||
|
Loading…
Reference in New Issue
Block a user