@iconify/react
Advanced tools
Comparing version 3.0.1 to 3.1.0-beta.1
@@ -36,9 +36,5 @@ import { default as React_2 } from 'react'; | ||
/** | ||
* Params for sendQuery() | ||
* API query parameters | ||
*/ | ||
declare interface APIQueryParams { | ||
provider: string; | ||
prefix: string; | ||
icons: string[]; | ||
} | ||
declare type APIQueryParamValue = number | string | boolean | undefined; | ||
@@ -67,9 +63,2 @@ /** | ||
/** | ||
* Function to filter item | ||
*/ | ||
declare interface FilterCallback { | ||
(item: GetQueryStatus): boolean; | ||
} | ||
/** | ||
* Signature for getAPIConfig | ||
@@ -129,2 +118,8 @@ */ | ||
export declare interface IconifyAPICustomQueryParams { | ||
type: 'custom'; | ||
provider?: string; | ||
uri: string; | ||
} | ||
/** | ||
@@ -145,2 +140,12 @@ * Iconify API functions | ||
/** | ||
* Params for sendQuery() | ||
*/ | ||
declare interface IconifyAPIIconsQueryParams { | ||
type: 'icons'; | ||
provider: string; | ||
prefix: string; | ||
icons: string[]; | ||
} | ||
/** | ||
* Exposed internal functions | ||
@@ -154,6 +159,2 @@ * | ||
/** | ||
* Get internal API data, used by Icon Finder | ||
*/ | ||
getAPI: (provider: string) => IconifyAPIInternalStorage | undefined; | ||
/** | ||
* Get API config, used by custom modules | ||
@@ -163,17 +164,21 @@ */ | ||
/** | ||
* Set API module | ||
* Set custom API module | ||
*/ | ||
setAPIModule: (provider: string, item: IconifyAPIModule) => void; | ||
/** | ||
* Optional setFetch (should be imported from ./modules/fetch if fetch is used) | ||
* | ||
* Used to set custom fetch function, such as one provided by cross-fetch, making fetch usable on server | ||
* Send API query | ||
*/ | ||
sendAPIQuery: (target: string | PartialIconifyAPIConfig, query: IconifyAPIQueryParams, callback: QueryDoneCallback) => QueryAbortCallback; | ||
/** | ||
* Optional setFetch and getFetch (should be imported from ./modules/fetch if fetch is used) | ||
*/ | ||
setFetch?: (item: typeof fetch) => void; | ||
getFetch?: () => typeof fetch | null; | ||
/** | ||
* Merge parameters | ||
*/ | ||
mergeParams: MergeParams; | ||
} | ||
export declare interface IconifyAPIInternalStorage { | ||
config: IconifyAPIConfig; | ||
redundancy: Redundancy; | ||
} | ||
export declare type IconifyAPIMergeQueryParams = Record<string, APIQueryParamValue>; | ||
@@ -184,3 +189,3 @@ /** | ||
export declare interface IconifyAPIModule { | ||
prepare: IconifyAPIPrepareQuery; | ||
prepare: IconifyAPIPrepareIconsQuery; | ||
send: IconifyAPISendQuery; | ||
@@ -192,6 +197,8 @@ } | ||
*/ | ||
export declare type IconifyAPIPrepareQuery = (provider: string, prefix: string, icons: string[]) => APIQueryParams[]; | ||
export declare type IconifyAPIPrepareIconsQuery = (provider: string, prefix: string, icons: string[]) => IconifyAPIIconsQueryParams[]; | ||
export declare type IconifyAPISendQuery = (host: string, params: APIQueryParams, status: PendingQueryItem) => void; | ||
export declare type IconifyAPIQueryParams = IconifyAPIIconsQueryParams | IconifyAPICustomQueryParams; | ||
export declare type IconifyAPISendQuery = (host: string, params: IconifyAPIQueryParams, status: PendingQueryItem) => void; | ||
/** | ||
@@ -557,2 +564,7 @@ * Interface for exported functions | ||
/** | ||
* Type for mergeParams() | ||
*/ | ||
declare type MergeParams = (base: string, params: IconifyAPIMergeQueryParams) => string; | ||
export declare type PartialIconifyAPIConfig = Partial<IconifyAPIConfig>; | ||
@@ -589,7 +601,2 @@ | ||
/** | ||
* Function to send to item to send query | ||
*/ | ||
declare type QueryModuleCallback = (resource: RedundancyResource, payload: QueryPayload, queryItem: PendingQueryItem) => void; | ||
/** | ||
* Custom payload | ||
@@ -632,13 +639,2 @@ */ | ||
/** | ||
* Redundancy instance | ||
*/ | ||
declare interface Redundancy { | ||
query: (payload: unknown, queryCallback: QueryModuleCallback, doneCallback?: QueryDoneCallback) => GetQueryStatus; | ||
find: (callback: FilterCallback) => GetQueryStatus | null; | ||
setIndex: (index: number) => void; | ||
getIndex: () => number; | ||
cleanup: () => void; | ||
} | ||
/** | ||
* Configuration object | ||
@@ -645,0 +641,0 @@ */ |
@@ -5,3 +5,3 @@ { | ||
"author": "Vjacheslav Trushkin", | ||
"version": "3.0.1", | ||
"version": "3.1.0-beta.1", | ||
"license": "MIT", | ||
@@ -31,3 +31,3 @@ "bugs": "https://github.com/iconify/iconify/issues", | ||
"@babel/preset-react": "^7.13.13", | ||
"@iconify/core": "^1.1.3", | ||
"@iconify/core": "^1.2.0-beta.1", | ||
"@iconify/types": "^1.0.6", | ||
@@ -45,3 +45,6 @@ "@iconify/utils": "^1.0.7", | ||
"typescript": "^4.2.4" | ||
}, | ||
"dependencies": { | ||
"cross-fetch": "^3.1.4" | ||
} | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
4
372038
1
16
10440
3
+ Addedcross-fetch@^3.1.4
+ Addedcross-fetch@3.2.0(transitive)
+ Addednode-fetch@2.7.0(transitive)
+ Addedtr46@0.0.3(transitive)
+ Addedwebidl-conversions@3.0.1(transitive)
+ Addedwhatwg-url@5.0.0(transitive)