mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
141 lines
3.2 KiB
Diff
141 lines
3.2 KiB
Diff
--- old.jsDeclarationsFunctionClassesCjsExportAssignment(target=es2015).js
|
|
+++ new.jsDeclarationsFunctionClassesCjsExportAssignment(target=es2015).js
|
|
@@= skipped -145, +145 lines =@@
|
|
* @param {number} timeout
|
|
*/
|
|
declare function Timer(timeout: number): void;
|
|
-declare class Timer {
|
|
- /**
|
|
- * @param {number} timeout
|
|
- */
|
|
- constructor(timeout: number);
|
|
- timeout: number;
|
|
-}
|
|
//// [context.d.ts]
|
|
-export = Context;
|
|
/**
|
|
* Imports
|
|
*
|
|
@@= skipped -16, +8 lines =@@
|
|
* @typedef {import("./hook")} Hook
|
|
* @typedef {import("./hook").HookHandler} HookHandler
|
|
*/
|
|
+export = Context;
|
|
+export type Timer = import("./timer");
|
|
+export type Hook = import("./hook");
|
|
+export type HookHandler = import("./hook").HookHandler;
|
|
+export type Input = {
|
|
+ timer: Timer;
|
|
+ hook: Hook;
|
|
+};
|
|
+export type State = {
|
|
+ timer: Timer;
|
|
+ hook: Hook;
|
|
+};
|
|
/**
|
|
* Input type definition
|
|
*
|
|
@@= skipped -20, +32 lines =@@
|
|
* @class
|
|
* @param {Input} input
|
|
*/
|
|
-declare function Context(input: Input): Context | undefined;
|
|
-declare class Context {
|
|
- /**
|
|
- * Imports
|
|
- *
|
|
- * @typedef {import("./timer")} Timer
|
|
- * @typedef {import("./hook")} Hook
|
|
- * @typedef {import("./hook").HookHandler} HookHandler
|
|
- */
|
|
- /**
|
|
- * Input type definition
|
|
- *
|
|
- * @typedef {Object} Input
|
|
- * @prop {Timer} timer
|
|
- * @prop {Hook} hook
|
|
- */
|
|
- /**
|
|
- * State type definition
|
|
- *
|
|
- * @typedef {Object} State
|
|
- * @prop {Timer} timer
|
|
- * @prop {Hook} hook
|
|
- */
|
|
- /**
|
|
- * New `Context`
|
|
- *
|
|
- * @class
|
|
- * @param {Input} input
|
|
- */
|
|
- constructor(input: Input);
|
|
- state: State | undefined;
|
|
- /**
|
|
- * @param {Input} input
|
|
- * @param {HookHandler=} handle
|
|
- * @returns {State}
|
|
- */
|
|
- construct(input: Input, handle?: HookHandler | undefined): State;
|
|
-}
|
|
+declare function Context(input: Input): any;
|
|
declare namespace Context {
|
|
- export { Timer, Hook, HookHandler, Input, State };
|
|
+ var prototype: {
|
|
+ /**
|
|
+ * @param {Input} input
|
|
+ * @param {HookHandler=} handle
|
|
+ * @returns {State}
|
|
+ */
|
|
+ construct(input: Input, handle?: HookHandler | undefined): State;
|
|
+ };
|
|
}
|
|
-/**
|
|
- * Imports
|
|
- */
|
|
-type Timer = import("./timer");
|
|
-/**
|
|
- * Imports
|
|
- */
|
|
-type Hook = import("./hook");
|
|
-/**
|
|
- * Imports
|
|
- */
|
|
-type HookHandler = import("./hook").HookHandler;
|
|
-/**
|
|
- * Input type definition
|
|
- */
|
|
-type Input = {
|
|
- timer: Timer;
|
|
- hook: Hook;
|
|
-};
|
|
-/**
|
|
- * State type definition
|
|
- */
|
|
-type State = {
|
|
- timer: Timer;
|
|
- hook: Hook;
|
|
-};
|
|
//// [hook.d.ts]
|
|
export = Hook;
|
|
+export type HookHandler = (arg: import("./context")) => void;
|
|
/**
|
|
* @typedef {(arg: import("./context")) => void} HookHandler
|
|
*/
|
|
@@= skipped -76, +21 lines =@@
|
|
* @param {HookHandler} handle
|
|
*/
|
|
declare function Hook(handle: HookHandler): void;
|
|
-declare class Hook {
|
|
- /**
|
|
- * @typedef {(arg: import("./context")) => void} HookHandler
|
|
- */
|
|
- /**
|
|
- * @param {HookHandler} handle
|
|
- */
|
|
- constructor(handle: HookHandler);
|
|
- handle: HookHandler;
|
|
-}
|
|
-declare namespace Hook {
|
|
- export { HookHandler };
|
|
-}
|
|
-type HookHandler = (arg: import("./context")) => void;
|