@aws-amplify/core
Version:
Core category of aws-amplify
28 lines (27 loc) • 972 B
TypeScript
/**
* Date & time utility functions to abstract the `aws-sdk` away from users.
* (v2 => v3 modularization is a breaking change)
*
* @see https://github.com/aws/aws-sdk-js/blob/6edf586dcc1de7fe8fbfbbd9a0d2b1847921e6e1/lib/util.js#L262
*/
type DateUtils = {
clockOffset: number;
getDateWithClockOffset: () => Date;
getClockOffset: () => number;
getHeaderStringFromDate: (date: Date) => string;
getDateFromHeaderString: (header: string) => Date;
isClockSkewed: (serverDate: Date) => boolean;
isClockSkewError: (error: any) => boolean;
setClockOffset: (offset: number) => void;
};
/**
* This utility is intended to be deprecated and replaced by `signRequest` and `presignUrl` functions from
* `clients/middleware/signing/signer/signatureV4`.
*
* TODO: refactor the logics here into `signRequest` and `presignUrl` functions and remove this class.
*
* @internal
* @deprecated
*/
export declare const DateUtils: DateUtils;
export {};