@atlaskit/util-service-support
Version:
A library of support classes for integrating React components with REST HTTP services
134 lines (108 loc) • 3.03 kB
Markdown
<!-- API Report Version: 2.3 -->
> Do not edit this file. This report is auto-generated using
> [API Extractor](https://api-extractor.com/).
> [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
- [Main Entry Types](
- [Peer Dependencies](
<!--SECTION START: Main Entry Types-->
```ts
// @public (undocumented)
export abstract class AbstractResource<Q, R, E, I, O> implements Provider<Q, R, E, I, O> {
// (undocumented)
abstract filter(query?: Q, options?: O): void;
// (undocumented)
protected notifyError(error: E): void;
// (undocumented)
protected notifyInfo(info: I): void;
// (undocumented)
protected notifyNotReady(): void;
// (undocumented)
protected notifyResult(result: R): void;
// (undocumented)
subscribe(onChange: OnProviderChange<R, E, I>): void;
// (undocumented)
unsubscribe(onChange: OnProviderChange<R, E, I>): void;
}
// @public (undocumented)
export const buildCredentials: (secOptions?: SecurityOptions) => 'include' | 'omit';
// @public (undocumented)
export interface KeyValues {
// (undocumented)
[]: any;
}
// @public (undocumented)
export interface OnProviderChange<R, E, I> {
error?(error: E): void;
info?(info: I): void;
notReady?(): void;
result(result: R): void;
}
// @public
export interface Provider<Q, R, E, I, O> {
filter(query?: Q, options?: O): void;
// (undocumented)
subscribe(onChange: OnProviderChange<R, E, I>): void;
// (undocumented)
unsubscribe(onChange: OnProviderChange<R, E, I>): void;
}
// @public
export interface RefreshSecurityProvider {
// (undocumented)
(): Promise<SecurityOptions>;
}
// @public (undocumented)
const requestService: <T>(
serviceConfig: ServiceConfig,
options?: RequestServiceOptions,
) => Promise<T>;
// @public (undocumented)
export interface RequestServiceOptions {
// (undocumented)
ignoreResponsePayload?: boolean;
// (undocumented)
path?: string;
// (undocumented)
queryParams?: KeyValues;
// (undocumented)
requestInit?: RequestInit;
}
// @public (undocumented)
export interface SecurityOptions {
// (undocumented)
headers?: KeyValues;
// (undocumented)
omitCredentials?: boolean;
// (undocumented)
params?: KeyValues;
}
// @public
export interface SecurityProvider {
// (undocumented)
(): SecurityOptions;
}
// @public (undocumented)
export interface ServiceConfig {
// (undocumented)
refreshedSecurityProvider?: RefreshSecurityProvider;
// (undocumented)
securityProvider?: SecurityProvider;
// (undocumented)
url: string;
}
declare namespace serviceUtils {
export { requestService };
}
// @public (undocumented)
export const utils: typeof serviceUtils;
// (No @packageDocumentation comment for this package)
```
<!--SECTION END: Main Entry Types-->
<!--SECTION START: Peer Dependencies-->
```json
{}
```
<!--SECTION END: Peer Dependencies-->