fruit-company
Version:
Apple services library
36 lines (35 loc) • 1.26 kB
TypeScript
import { SereneAuthority, SereneAuthorityAuthenticateOptions, SereneAuthorityRefreshOptions } from "serene-front";
/**
* A token used to interact with weather services.
*/
export declare class MapsToken implements SereneAuthority {
private readonly appId;
private readonly teamId;
private readonly keyId;
private readonly privateKey;
/**
* Create a token to interact with weather services.
*
* @param appId An app identifier from an Apple developer account.
* @param teamId A team identifier from an Apple developer account.
* @param keyId The identifier of the key used to sign requests.
* @param privateKey A WeatherKit REST key generated using an Apple developer account.
*/
constructor(appId: string, teamId: string, keyId: string, privateKey: string);
/**
* The bearer token used to decorate requests.
*/
private accessToken;
/**
* When this token expires.
*/
private expiresAt;
get retryLimit(): number;
get isValid(): boolean;
refresh({ fetch }: SereneAuthorityRefreshOptions): Promise<void>;
authenticate({ fetchRequest }: SereneAuthorityAuthenticateOptions): Promise<Request>;
/**
* @ignore
*/
toString(): string;
}