Skip to content

Commit

Permalink
Add declaration files
Browse files Browse the repository at this point in the history
  • Loading branch information
yeskunall committed Nov 2, 2018
1 parent 593e3eb commit 4ac52e7
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 0 deletions.
18 changes: 18 additions & 0 deletions packages/react-device-orientation-hook/src/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
export declare type UseState = <T>(
initialState: T,
) => [T, (newState: T) => void];
export declare const useState: UseState;
export declare type UseEffect = (
didUpdate: () => (() => void) | void,
params?: any[],
) => void;
export declare const useEffect: UseEffect;
export interface IOrientationState {
angle: number;
type: string;
}
export declare const defaultState: IOrientationState;
declare const useOrientation: (
initialState?: IOrientationState,
) => IOrientationState;
export default useOrientation;
12 changes: 12 additions & 0 deletions packages/react-notification-hook/src/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
export declare type UseCallback = <T extends ((...args: any[]) => any)>(
callback: T,
args: any[],
) => T;
export declare const useCallback: UseCallback;
export interface INotification {
options?: object;
title: string;
}
export declare const defaultValue: INotification;
declare const useNotification: (value?: INotification) => () => () => void;
export default useNotification;
13 changes: 13 additions & 0 deletions packages/react-online-status-hook/src/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
export declare type UseState = <T>(
initialState: T,
) => [T, (newState: T) => void];
export declare const useState: UseState;
export declare type UseEffect = (
didUpdate: () => (() => void) | void,
params?: any[],
) => void;
export declare const useEffect: UseEffect;
export declare const useOfflineOnlineStatus: () => boolean;
export declare const useOfflineStatus: () => boolean;
export declare const useOnlineStatus: () => boolean;
export default useOfflineOnlineStatus;
16 changes: 16 additions & 0 deletions packages/react-page-visible-hook/src/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
export declare type UseState = <T>(
initialState: T,
) => [T, (newState: T) => void];
export declare const useState: UseState;
export declare type UseEffect = (
didUpdate: () => (() => void) | void,
params?: any[],
) => void;
export declare const useEffect: UseEffect;
export interface IPageVisibilityState {
readonly hidden: boolean;
readonly visibilityState: string;
}
export declare const initialState: IPageVisibilityState;
declare const useVisible: () => IPageVisibilityState;
export default useVisible;
9 changes: 9 additions & 0 deletions packages/react-vibration-hook/src/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export declare type UseCallback = <T extends ((...args: any[]) => any)>(
callback: T,
args: any[],
) => T;
export declare const useCallback: UseCallback;
export declare type Vibrate = number | number[];
export declare const defaultValue: Vibrate;
declare const useVibration: (value?: Vibrate) => () => () => void;
export default useVibration;

0 comments on commit 4ac52e7

Please sign in to comment.