Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ahooks

Package Overview
Dependencies
Maintainers
5
Versions
111
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ahooks - npm Package Compare versions

Comparing version 3.0.3 to 3.0.5

49

es/useAntdTable/index.d.ts

@@ -1,48 +0,3 @@

import type { AntdTableOptions, Data, Params, Service } from './types';
declare const useAntdTable: <TData extends Data, TParams extends any[] = Params>(service: Service<TData, TParams>, options?: AntdTableOptions<TData, TParams>) => {
tableProps: {
dataSource: any[];
loading: boolean;
onChange: (pagination: any, filters: any, sorter: any) => void;
pagination: {
current: any;
pageSize: any;
total: number;
};
};
search: {
submit: (e?: any) => void;
type: any;
changeType: () => void;
reset: () => void;
};
pagination: {
current: any;
pageSize: any;
total: number;
totalPage: number;
onChange: (c: number, p: number) => void;
changeCurrent: (c: number) => void;
changePageSize: (p: number) => void;
};
loading: boolean;
data?: TData | undefined;
error?: Error | undefined;
params: [] | TParams | {
current: number;
pageSize: number;
}[];
cancel: () => void;
refresh: () => void;
refreshAsync: () => Promise<TData>;
run: (...params: TParams | {
current: number;
pageSize: number;
}[]) => void;
runAsync: (...params: TParams | {
current: number;
pageSize: number;
}[]) => Promise<TData>;
mutate: (data?: TData | ((oldData?: TData | undefined) => TData | undefined) | undefined) => void;
};
import type { AntdTableOptions, Data, Params, Service, AntdTableResult } from './types';
declare const useAntdTable: <TData extends Data, TParams extends Params>(service: Service<TData, TParams>, options?: AntdTableOptions<TData, TParams>) => AntdTableResult<TData, TParams>;
export default useAntdTable;

7

es/useAntdTable/index.js

@@ -195,2 +195,3 @@ var __assign = this && this.__assign || function () {

if (!form) {
// @ts-ignore
run(pagination);

@@ -201,3 +202,4 @@ return;

allFormDataRef.current = __assign(__assign({}, allFormDataRef.current), values);
allFormDataRef.current = __assign(__assign({}, allFormDataRef.current), values); // @ts-ignore
run(pagination, values, {

@@ -247,3 +249,4 @@ allFormData: allFormDataRef.current,

allFormDataRef.current = (cacheFormTableData === null || cacheFormTableData === void 0 ? void 0 : cacheFormTableData.allFormData) || {};
restoreForm();
restoreForm(); // @ts-ignore
run.apply(void 0, __spread(params));

@@ -250,0 +253,0 @@ return;

@@ -13,3 +13,3 @@ import type { PaginationOptions, PaginationResult } from '../usePagination/types';

}, ...any[]];
export declare type Service<TData extends Data, TParams extends any[]> = (...args: TParams) => Promise<TData>;
export declare type Service<TData extends Data, TParams extends Params> = (...args: TParams) => Promise<TData>;
export declare type Antd3ValidateFields = (fieldNames: string[], callback: (errors: any, values: Record<string, any>) => void) => void;

@@ -26,3 +26,3 @@ export declare type Antd4ValidateFields = (fieldNames?: string[]) => Promise<Record<string, any>>;

}
export interface AntdTableResult<TData extends Data, TParams extends any[]> extends PaginationResult<TData, TParams> {
export interface AntdTableResult<TData extends Data, TParams extends Params> extends PaginationResult<TData, TParams> {
tableProps: {

@@ -42,5 +42,5 @@ dataSource: any[];

}
export interface AntdTableOptions<TData extends Data, TParams extends any[]> extends PaginationOptions<TData, TParams> {
export interface AntdTableOptions<TData extends Data, TParams extends Params> extends PaginationOptions<TData, TParams> {
form?: AntdFormUtils;
defaultType?: 'simple' | 'advance';
}
import type { Data, Params, Service } from '../useAntdTable/types';
import type { FusionTableOptions, FusionTableResult } from './types';
declare const useFusionTable: <TData extends Data, TParams extends any[] = Params>(service: Service<TData, TParams>, options?: FusionTableOptions<TData, TParams>) => FusionTableResult<TData, TParams>;
declare const useFusionTable: <TData extends Data, TParams extends Params>(service: Service<TData, TParams>, options?: FusionTableOptions<TData, TParams>) => FusionTableResult<TData, TParams>;
export default useFusionTable;

@@ -1,2 +0,2 @@

import type { AntdTableOptions, AntdTableResult, Data } from '../useAntdTable/types';
import type { AntdTableOptions, AntdTableResult, Data, Params } from '../useAntdTable/types';
export interface Field {

@@ -10,3 +10,3 @@ getFieldInstance?: (name: string) => {};

}
export interface FusionTableResult<TData extends Data, TParams extends any[]> extends Omit<AntdTableResult<TData, TParams>, 'tableProps'> {
export interface FusionTableResult<TData extends Data, TParams extends Params> extends Omit<AntdTableResult<TData, TParams>, 'tableProps'> {
paginationProps: {

@@ -32,4 +32,4 @@ onChange: (current: number) => void;

}
export interface FusionTableOptions<TData extends Data, TParams extends any[]> extends Omit<AntdTableOptions<TData, TParams>, 'form'> {
export interface FusionTableOptions<TData extends Data, TParams extends Params> extends Omit<AntdTableOptions<TData, TParams>, 'form'> {
field?: Field;
}

@@ -1,32 +0,3 @@

import type { Data, PaginationOptions, Params, Service } from './types';
declare const usePagination: <TData extends Data, TParams extends any[] = Params>(service: Service<TData, TParams>, options?: PaginationOptions<TData, TParams>) => {
pagination: {
current: any;
pageSize: any;
total: number;
totalPage: number;
onChange: (c: number, p: number) => void;
changeCurrent: (c: number) => void;
changePageSize: (p: number) => void;
};
loading: boolean;
data?: TData | undefined;
error?: Error | undefined;
params: [] | TParams | {
current: number;
pageSize: number;
}[];
cancel: () => void;
refresh: () => void;
refreshAsync: () => Promise<TData>;
run: (...params: TParams | {
current: number;
pageSize: number;
}[]) => void;
runAsync: (...params: TParams | {
current: number;
pageSize: number;
}[]) => Promise<TData>;
mutate: (data?: TData | ((oldData?: TData | undefined) => TData | undefined) | undefined) => void;
};
import type { Data, PaginationOptions, Params, Service, PaginationResult } from './types';
declare const usePagination: <TData extends Data, TParams extends Params>(service: Service<TData, TParams>, options?: PaginationOptions<TData, TParams>) => PaginationResult<TData, TParams>;
export default usePagination;

@@ -11,4 +11,4 @@ import type { Options, Result } from '../useRequest/src/types';

}, ...any[]];
export declare type Service<TData extends Data, TParams extends any[]> = (...args: TParams) => Promise<TData>;
export interface PaginationResult<TData extends Data, TParams extends any[]> extends Result<TData, TParams> {
export declare type Service<TData extends Data, TParams extends Params> = (...args: TParams) => Promise<TData>;
export interface PaginationResult<TData extends Data, TParams extends Params> extends Result<TData, TParams> {
pagination: {

@@ -24,4 +24,4 @@ current: number;

}
export interface PaginationOptions<TData extends Data, TParams extends any[]> extends Options<TData, TParams> {
export interface PaginationOptions<TData extends Data, TParams extends Params> extends Options<TData, TParams> {
defaultPageSize?: number;
}

@@ -69,1 +69,2 @@ import type { DependencyList } from 'react';

}
export declare type Timeout = ReturnType<typeof setTimeout>;

@@ -1,48 +0,3 @@

import type { AntdTableOptions, Data, Params, Service } from './types';
declare const useAntdTable: <TData extends Data, TParams extends any[] = Params>(service: Service<TData, TParams>, options?: AntdTableOptions<TData, TParams>) => {
tableProps: {
dataSource: any[];
loading: boolean;
onChange: (pagination: any, filters: any, sorter: any) => void;
pagination: {
current: any;
pageSize: any;
total: number;
};
};
search: {
submit: (e?: any) => void;
type: any;
changeType: () => void;
reset: () => void;
};
pagination: {
current: any;
pageSize: any;
total: number;
totalPage: number;
onChange: (c: number, p: number) => void;
changeCurrent: (c: number) => void;
changePageSize: (p: number) => void;
};
loading: boolean;
data?: TData | undefined;
error?: Error | undefined;
params: [] | TParams | {
current: number;
pageSize: number;
}[];
cancel: () => void;
refresh: () => void;
refreshAsync: () => Promise<TData>;
run: (...params: TParams | {
current: number;
pageSize: number;
}[]) => void;
runAsync: (...params: TParams | {
current: number;
pageSize: number;
}[]) => Promise<TData>;
mutate: (data?: TData | ((oldData?: TData | undefined) => TData | undefined) | undefined) => void;
};
import type { AntdTableOptions, Data, Params, Service, AntdTableResult } from './types';
declare const useAntdTable: <TData extends Data, TParams extends Params>(service: Service<TData, TParams>, options?: AntdTableOptions<TData, TParams>) => AntdTableResult<TData, TParams>;
export default useAntdTable;

@@ -203,2 +203,3 @@ "use strict";

if (!form) {
// @ts-ignore
run(pagination);

@@ -209,3 +210,4 @@ return;

allFormDataRef.current = __assign(__assign({}, allFormDataRef.current), values);
allFormDataRef.current = __assign(__assign({}, allFormDataRef.current), values); // @ts-ignore
run(pagination, values, {

@@ -255,3 +257,4 @@ allFormData: allFormDataRef.current,

allFormDataRef.current = (cacheFormTableData === null || cacheFormTableData === void 0 ? void 0 : cacheFormTableData.allFormData) || {};
restoreForm();
restoreForm(); // @ts-ignore
run.apply(void 0, __spread(params));

@@ -258,0 +261,0 @@ return;

@@ -13,3 +13,3 @@ import type { PaginationOptions, PaginationResult } from '../usePagination/types';

}, ...any[]];
export declare type Service<TData extends Data, TParams extends any[]> = (...args: TParams) => Promise<TData>;
export declare type Service<TData extends Data, TParams extends Params> = (...args: TParams) => Promise<TData>;
export declare type Antd3ValidateFields = (fieldNames: string[], callback: (errors: any, values: Record<string, any>) => void) => void;

@@ -26,3 +26,3 @@ export declare type Antd4ValidateFields = (fieldNames?: string[]) => Promise<Record<string, any>>;

}
export interface AntdTableResult<TData extends Data, TParams extends any[]> extends PaginationResult<TData, TParams> {
export interface AntdTableResult<TData extends Data, TParams extends Params> extends PaginationResult<TData, TParams> {
tableProps: {

@@ -42,5 +42,5 @@ dataSource: any[];

}
export interface AntdTableOptions<TData extends Data, TParams extends any[]> extends PaginationOptions<TData, TParams> {
export interface AntdTableOptions<TData extends Data, TParams extends Params> extends PaginationOptions<TData, TParams> {
form?: AntdFormUtils;
defaultType?: 'simple' | 'advance';
}
import type { Data, Params, Service } from '../useAntdTable/types';
import type { FusionTableOptions, FusionTableResult } from './types';
declare const useFusionTable: <TData extends Data, TParams extends any[] = Params>(service: Service<TData, TParams>, options?: FusionTableOptions<TData, TParams>) => FusionTableResult<TData, TParams>;
declare const useFusionTable: <TData extends Data, TParams extends Params>(service: Service<TData, TParams>, options?: FusionTableOptions<TData, TParams>) => FusionTableResult<TData, TParams>;
export default useFusionTable;

@@ -1,2 +0,2 @@

import type { AntdTableOptions, AntdTableResult, Data } from '../useAntdTable/types';
import type { AntdTableOptions, AntdTableResult, Data, Params } from '../useAntdTable/types';
export interface Field {

@@ -10,3 +10,3 @@ getFieldInstance?: (name: string) => {};

}
export interface FusionTableResult<TData extends Data, TParams extends any[]> extends Omit<AntdTableResult<TData, TParams>, 'tableProps'> {
export interface FusionTableResult<TData extends Data, TParams extends Params> extends Omit<AntdTableResult<TData, TParams>, 'tableProps'> {
paginationProps: {

@@ -32,4 +32,4 @@ onChange: (current: number) => void;

}
export interface FusionTableOptions<TData extends Data, TParams extends any[]> extends Omit<AntdTableOptions<TData, TParams>, 'form'> {
export interface FusionTableOptions<TData extends Data, TParams extends Params> extends Omit<AntdTableOptions<TData, TParams>, 'form'> {
field?: Field;
}

@@ -1,32 +0,3 @@

import type { Data, PaginationOptions, Params, Service } from './types';
declare const usePagination: <TData extends Data, TParams extends any[] = Params>(service: Service<TData, TParams>, options?: PaginationOptions<TData, TParams>) => {
pagination: {
current: any;
pageSize: any;
total: number;
totalPage: number;
onChange: (c: number, p: number) => void;
changeCurrent: (c: number) => void;
changePageSize: (p: number) => void;
};
loading: boolean;
data?: TData | undefined;
error?: Error | undefined;
params: [] | TParams | {
current: number;
pageSize: number;
}[];
cancel: () => void;
refresh: () => void;
refreshAsync: () => Promise<TData>;
run: (...params: TParams | {
current: number;
pageSize: number;
}[]) => void;
runAsync: (...params: TParams | {
current: number;
pageSize: number;
}[]) => Promise<TData>;
mutate: (data?: TData | ((oldData?: TData | undefined) => TData | undefined) | undefined) => void;
};
import type { Data, PaginationOptions, Params, Service, PaginationResult } from './types';
declare const usePagination: <TData extends Data, TParams extends Params>(service: Service<TData, TParams>, options?: PaginationOptions<TData, TParams>) => PaginationResult<TData, TParams>;
export default usePagination;

@@ -11,4 +11,4 @@ import type { Options, Result } from '../useRequest/src/types';

}, ...any[]];
export declare type Service<TData extends Data, TParams extends any[]> = (...args: TParams) => Promise<TData>;
export interface PaginationResult<TData extends Data, TParams extends any[]> extends Result<TData, TParams> {
export declare type Service<TData extends Data, TParams extends Params> = (...args: TParams) => Promise<TData>;
export interface PaginationResult<TData extends Data, TParams extends Params> extends Result<TData, TParams> {
pagination: {

@@ -24,4 +24,4 @@ current: number;

}
export interface PaginationOptions<TData extends Data, TParams extends any[]> extends Options<TData, TParams> {
export interface PaginationOptions<TData extends Data, TParams extends Params> extends Options<TData, TParams> {
defaultPageSize?: number;
}

@@ -69,1 +69,2 @@ import type { DependencyList } from 'react';

}
export declare type Timeout = ReturnType<typeof setTimeout>;
{
"name": "ahooks",
"version": "3.0.3",
"version": "3.0.5",
"description": "react hooks library",

@@ -61,3 +61,3 @@ "keywords": [

"license": "MIT",
"gitHead": "c1f3e650d65e9f69aa83bdcff3f8f8f364063167"
"gitHead": "ed3d6c0bb2ad3cf688ea844d7574b8cad49c8dd8"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc