mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
29 lines
601 B
TypeScript
29 lines
601 B
TypeScript
import { element, text } from 'estimate';
|
|
|
|
function assertType<T>(value: T): T {
|
|
return value;
|
|
}
|
|
|
|
element(document.body);
|
|
element(document.createElement('article'));
|
|
element(document.createElement('article'), {});
|
|
const estimate = element(document.createElement('article'), {
|
|
speed: 300,
|
|
spaces: /\W+/g,
|
|
});
|
|
|
|
assertType<number>(estimate.progress);
|
|
assertType<number>(estimate.remaining);
|
|
assertType<number>(estimate.total);
|
|
estimate.update();
|
|
estimate.initialize();
|
|
|
|
text('text');
|
|
text('text', {});
|
|
text('text', {
|
|
speed: 300,
|
|
spaces: /\W+/g,
|
|
});
|
|
|
|
assertType<number>(text('text'));
|