@aws-amplify/core

  • Version 4.2.5
  • Published
  • 7.96 MB
  • 8 dependencies
  • Apache-2.0 license

Install

npm i @aws-amplify/core
yarn add @aws-amplify/core
pnpm add @aws-amplify/core

Overview

Core category of aws-amplify

Index

Variables

Functions

Classes

Interfaces

Type Aliases

Namespaces

Variables

variable Amplify

const Amplify: AmplifyClass;

    variable AppState

    const AppState: { addEventListener: (action: any, handler: any) => any };

      variable AsyncStorage

      const AsyncStorage: any;

        variable AWS_CLOUDWATCH_BASE_BUFFER_SIZE

        const AWS_CLOUDWATCH_BASE_BUFFER_SIZE: number;

          variable AWS_CLOUDWATCH_CATEGORY

          const AWS_CLOUDWATCH_CATEGORY: string;

            variable AWS_CLOUDWATCH_MAX_BATCH_EVENT_SIZE

            const AWS_CLOUDWATCH_MAX_BATCH_EVENT_SIZE: number;

              variable AWS_CLOUDWATCH_MAX_EVENT_SIZE

              const AWS_CLOUDWATCH_MAX_EVENT_SIZE: number;

                variable AWS_CLOUDWATCH_PROVIDER_NAME

                const AWS_CLOUDWATCH_PROVIDER_NAME: string;

                  variable Constants

                  const Constants: { userAgent: string };

                    variable Credentials

                    const Credentials: CredentialsClass;

                      variable DateUtils

                      const DateUtils: any;
                      • Date & time utility functions to abstract the aws-sdk away from users. (v2 => v3 modularization is a breaking change)

                        See Also

                        • https://github.com/aws/aws-sdk-js/blob/6edf586dcc1de7fe8fbfbbd9a0d2b1847921e6e1/lib/util.js#L262

                      variable FacebookOAuth

                      const FacebookOAuth: FacebookOAuthClass;

                        variable GoogleOAuth

                        const GoogleOAuth: GoogleOAuthClass;

                          variable Hub

                          const Hub: HubClass;

                            variable INTERNAL_AWS_APPSYNC_PUBSUB_PROVIDER

                            const INTERNAL_AWS_APPSYNC_PUBSUB_PROVIDER: string | symbol;

                              variable INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER

                              const INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER: string | symbol;

                                variable Linking

                                const Linking: {};

                                  variable NO_CREDS_ERROR_STRING

                                  const NO_CREDS_ERROR_STRING: string;

                                    variable Platform

                                    const Platform: {
                                    userAgent: string;
                                    product: string;
                                    navigator: any;
                                    isReactNative: boolean;
                                    };

                                      variable RETRY_ERROR_CODES

                                      const RETRY_ERROR_CODES: string[];

                                        variable USER_AGENT_HEADER

                                        const USER_AGENT_HEADER: string;

                                          Functions

                                          function browserOrNode

                                          browserOrNode: () => { isBrowser: boolean; isNode: boolean };

                                            function filenameToContentType

                                            filenameToContentType: (filename: any, defVal?: string) => string;

                                              function generateRandomString

                                              generateRandomString: () => string;

                                                function getAmplifyUserAgent

                                                getAmplifyUserAgent: () => string;

                                                  function invalidParameter

                                                  invalidParameter: (name: string) => Error;

                                                    function isEmpty

                                                    isEmpty: (obj?: {}) => boolean;

                                                      function isStrictObject

                                                      isStrictObject: (obj: any) => boolean;
                                                      • Return true if the object is a strict object which means it's not Array, Function, Number, String, Boolean or Null

                                                        Parameter obj

                                                        the Object

                                                      function isTextFile

                                                      isTextFile: (contentType: any) => boolean;

                                                        function isWebWorker

                                                        isWebWorker: () => boolean;

                                                          function jitteredExponentialRetry

                                                          jitteredExponentialRetry: (
                                                          functionToRetry: Function,
                                                          args: any[],
                                                          maxDelayMs?: number
                                                          ) => any;
                                                          • Internal use of Amplify only

                                                          function makeQuerablePromise

                                                          makeQuerablePromise: (promise: any) => any;

                                                            function missingConfig

                                                            missingConfig: (name: string) => Error;

                                                              function objectLessAttributes

                                                              objectLessAttributes: (obj: any, less: any) => any;

                                                                function parseMobileHubConfig

                                                                parseMobileHubConfig: (config: any) => AmplifyConfig;

                                                                  function retry

                                                                  retry: (
                                                                  functionToRetry: Function,
                                                                  args: any[],
                                                                  delayFn: DelayFunction,
                                                                  attempt?: number
                                                                  ) => any;
                                                                  • Internal use of Amplify only

                                                                  function sortByField

                                                                  sortByField: (list: any, field: any, dir: any) => boolean;

                                                                    function transferKeyToLowerCase

                                                                    transferKeyToLowerCase: (
                                                                    obj: any,
                                                                    whiteListForItself?: any[],
                                                                    whiteListForChildren?: any[]
                                                                    ) => any;
                                                                    • transfer the first letter of the keys to lowercase

                                                                      Parameter obj

                                                                      the object need to be transferred

                                                                      Parameter whiteListForItself

                                                                      whitelist itself from being transferred

                                                                      Parameter whiteListForChildren

                                                                      whitelist its children keys from being transferred

                                                                    function transferKeyToUpperCase

                                                                    transferKeyToUpperCase: (
                                                                    obj: any,
                                                                    whiteListForItself?: any[],
                                                                    whiteListForChildren?: any[]
                                                                    ) => any;
                                                                    • transfer the first letter of the keys to lowercase

                                                                      Parameter obj

                                                                      the object need to be transferred

                                                                      Parameter whiteListForItself

                                                                      whitelist itself from being transferred

                                                                      Parameter whiteListForChildren

                                                                      whitelist its children keys from being transferred

                                                                    function urlSafeDecode

                                                                    urlSafeDecode: (hex: string) => string;

                                                                      function urlSafeEncode

                                                                      urlSafeEncode: (str: string) => string;

                                                                        Classes

                                                                        class AmplifyClass

                                                                        class AmplifyClass {}

                                                                          property Analytics

                                                                          Analytics: any;

                                                                            property API

                                                                            API: any;

                                                                              property Auth

                                                                              Auth: any;

                                                                                property Cache

                                                                                Cache: any;

                                                                                  property Credentials

                                                                                  Credentials: any;

                                                                                    property DataStore

                                                                                    DataStore: any;

                                                                                      property I18n

                                                                                      I18n: any;

                                                                                        property Interactions

                                                                                        Interactions: any;

                                                                                          property Logger

                                                                                          Logger: typeof LoggerClass;

                                                                                            property Predictions

                                                                                            Predictions: any;

                                                                                              property PubSub

                                                                                              PubSub: any;

                                                                                                property Pushnotification

                                                                                                Pushnotification: any;

                                                                                                  property ServiceWorker

                                                                                                  ServiceWorker: any;

                                                                                                    property Storage

                                                                                                    Storage: any;

                                                                                                      property UI

                                                                                                      UI: any;

                                                                                                        property XR

                                                                                                        XR: any;

                                                                                                          method addPluggable

                                                                                                          addPluggable: (pluggable: any) => void;

                                                                                                            method configure

                                                                                                            configure: (config?: any) => {};

                                                                                                              method register

                                                                                                              register: (comp: any) => void;

                                                                                                                class AWSCloudWatchProvider

                                                                                                                class AWSCloudWatchProvider implements LoggingProvider {}

                                                                                                                  constructor

                                                                                                                  constructor(config?: AWSCloudWatchProviderOptions);

                                                                                                                    property CATEGORY

                                                                                                                    static readonly CATEGORY: string;

                                                                                                                      property PROVIDER_NAME

                                                                                                                      static readonly PROVIDER_NAME: string;

                                                                                                                        method configure

                                                                                                                        configure: (
                                                                                                                        config?: AWSCloudWatchProviderOptions
                                                                                                                        ) => AWSCloudWatchProviderOptions;

                                                                                                                          method createLogGroup

                                                                                                                          createLogGroup: (params: any) => Promise<CreateLogGroupCommandOutput>;

                                                                                                                            method createLogStream

                                                                                                                            createLogStream: (params: any) => Promise<CreateLogStreamCommandOutput>;

                                                                                                                              method getCategoryName

                                                                                                                              getCategoryName: () => string;

                                                                                                                                method getLogEvents

                                                                                                                                getLogEvents: (params: any) => Promise<GetLogEventsCommandOutput>;

                                                                                                                                  method getLogGroups

                                                                                                                                  getLogGroups: (params: any) => Promise<DescribeLogGroupsCommandOutput>;

                                                                                                                                    method getLogQueue

                                                                                                                                    getLogQueue: () => InputLogEvent[];

                                                                                                                                      method getLogStreams

                                                                                                                                      getLogStreams: (params: any) => Promise<DescribeLogStreamsCommandOutput>;

                                                                                                                                        method getProviderName

                                                                                                                                        getProviderName: () => string;

                                                                                                                                          method pushLogs

                                                                                                                                          pushLogs: (logs: InputLogEvent[]) => void;

                                                                                                                                            class ClientDevice

                                                                                                                                            class ClientDevice {}

                                                                                                                                              method clientInfo

                                                                                                                                              static clientInfo: () =>
                                                                                                                                              | {
                                                                                                                                              platform?: undefined;
                                                                                                                                              make?: undefined;
                                                                                                                                              model?: undefined;
                                                                                                                                              version?: undefined;
                                                                                                                                              appVersion?: undefined;
                                                                                                                                              language?: undefined;
                                                                                                                                              timezone?: undefined;
                                                                                                                                              }
                                                                                                                                              | {
                                                                                                                                              platform: string;
                                                                                                                                              make: string;
                                                                                                                                              model: string;
                                                                                                                                              version: string;
                                                                                                                                              appVersion: string;
                                                                                                                                              language: string;
                                                                                                                                              timezone: string;
                                                                                                                                              };

                                                                                                                                                method dimension

                                                                                                                                                static dimension: () => { width: number; height: number };

                                                                                                                                                  class ConsoleLogger

                                                                                                                                                  class ConsoleLogger implements Logger {}
                                                                                                                                                  • Write logs Logger

                                                                                                                                                  constructor

                                                                                                                                                  constructor(name: string, level?: string);
                                                                                                                                                  • Parameter name

                                                                                                                                                    Name of the logger

                                                                                                                                                  property level

                                                                                                                                                  level: string;

                                                                                                                                                    property LOG_LEVEL

                                                                                                                                                    static LOG_LEVEL: any;

                                                                                                                                                      property name

                                                                                                                                                      name: string;

                                                                                                                                                        method addPluggable

                                                                                                                                                        addPluggable: (pluggable: LoggingProvider) => void;

                                                                                                                                                          method configure

                                                                                                                                                          configure: (config?: object) => object;

                                                                                                                                                            method debug

                                                                                                                                                            debug: (...msg: any[]) => void;
                                                                                                                                                            • Write DEBUG log Logger

                                                                                                                                                              Parameter msg

                                                                                                                                                              Logging message or object

                                                                                                                                                            method error

                                                                                                                                                            error: (...msg: any[]) => void;
                                                                                                                                                            • Write ERROR log Logger

                                                                                                                                                              Parameter msg

                                                                                                                                                              Logging message or object

                                                                                                                                                            method info

                                                                                                                                                            info: (...msg: any[]) => void;
                                                                                                                                                            • Write INFO log Logger

                                                                                                                                                              Parameter msg

                                                                                                                                                              Logging message or object

                                                                                                                                                            method listPluggables

                                                                                                                                                            listPluggables: () => LoggingProvider[];

                                                                                                                                                              method log

                                                                                                                                                              log: (...msg: any[]) => void;
                                                                                                                                                              • Write General log. Default to INFO Logger

                                                                                                                                                                Parameter msg

                                                                                                                                                                Logging message or object

                                                                                                                                                              method verbose

                                                                                                                                                              verbose: (...msg: any[]) => void;
                                                                                                                                                              • Write VERBOSE log Logger

                                                                                                                                                                Parameter msg

                                                                                                                                                                Logging message or object

                                                                                                                                                              method warn

                                                                                                                                                              warn: (...msg: any[]) => void;
                                                                                                                                                              • Write WARN log Logger

                                                                                                                                                                Parameter msg

                                                                                                                                                                Logging message or object

                                                                                                                                                              class CredentialsClass

                                                                                                                                                              class CredentialsClass {}

                                                                                                                                                                constructor

                                                                                                                                                                constructor(config: any);

                                                                                                                                                                  property Auth

                                                                                                                                                                  Auth: any;

                                                                                                                                                                    method clear

                                                                                                                                                                    clear: () => Promise<void>;

                                                                                                                                                                      method configure

                                                                                                                                                                      configure: (config: any) => any;

                                                                                                                                                                        method get

                                                                                                                                                                        get: () => any;

                                                                                                                                                                          method getCredSource

                                                                                                                                                                          getCredSource: () => any;

                                                                                                                                                                            method getModuleName

                                                                                                                                                                            getModuleName: () => string;

                                                                                                                                                                              method refreshFederatedToken

                                                                                                                                                                              refreshFederatedToken: (federatedInfo: any) => any;

                                                                                                                                                                                method set

                                                                                                                                                                                set: (params: any, source: any) => Promise<ICredentials>;

                                                                                                                                                                                  method shear

                                                                                                                                                                                  shear: (
                                                                                                                                                                                  credentials: any
                                                                                                                                                                                  ) => {
                                                                                                                                                                                  accessKeyId: any;
                                                                                                                                                                                  sessionToken: any;
                                                                                                                                                                                  secretAccessKey: any;
                                                                                                                                                                                  identityId: any;
                                                                                                                                                                                  authenticated: any;
                                                                                                                                                                                  };
                                                                                                                                                                                  • Compact version of credentials

                                                                                                                                                                                    Parameter credentials

                                                                                                                                                                                    {Object} - Credentials

                                                                                                                                                                                  class I18n

                                                                                                                                                                                  class I18n {}
                                                                                                                                                                                  • Export I18n APIs

                                                                                                                                                                                  method checkConfig

                                                                                                                                                                                  static checkConfig: () => boolean;

                                                                                                                                                                                    method configure

                                                                                                                                                                                    static configure: (config: any) => any;
                                                                                                                                                                                    • Configure I18n part

                                                                                                                                                                                      Parameter config

                                                                                                                                                                                      Configuration of the I18n

                                                                                                                                                                                    method createInstance

                                                                                                                                                                                    static createInstance: () => void;
                                                                                                                                                                                    • Create an instance of I18n for the library

                                                                                                                                                                                    method get

                                                                                                                                                                                    static get: (key: any, defVal?: any) => any;
                                                                                                                                                                                    • Get value

                                                                                                                                                                                      Parameter key

                                                                                                                                                                                      Parameter defVal

                                                                                                                                                                                      Default value

                                                                                                                                                                                    method getModuleName

                                                                                                                                                                                    static getModuleName: () => string;

                                                                                                                                                                                      method putVocabularies

                                                                                                                                                                                      static putVocabularies: (vocabularies: any) => any;
                                                                                                                                                                                      • Add vocabularies for one language

                                                                                                                                                                                        Parameter vocabularies

                                                                                                                                                                                        Object that has language as key, vocabularies of each language as value

                                                                                                                                                                                      method putVocabulariesForLanguage

                                                                                                                                                                                      static putVocabulariesForLanguage: (language: any, vocabularies: any) => any;
                                                                                                                                                                                      • Add vocabularies for one language

                                                                                                                                                                                        Parameter langurage

                                                                                                                                                                                        Language of the dictionary

                                                                                                                                                                                        Parameter vocabularies

                                                                                                                                                                                        Object that has key-value as dictionary entry

                                                                                                                                                                                      method setLanguage

                                                                                                                                                                                      static setLanguage: (lang: any) => any;
                                                                                                                                                                                      • Explicitly setting language

                                                                                                                                                                                        Parameter lang

                                                                                                                                                                                      class JS

                                                                                                                                                                                      class JS {}
                                                                                                                                                                                      • Deprecated

                                                                                                                                                                                        use per-function imports

                                                                                                                                                                                      property browserOrNode

                                                                                                                                                                                      static browserOrNode: () => { isBrowser: boolean; isNode: boolean };

                                                                                                                                                                                        property filenameToContentType

                                                                                                                                                                                        static filenameToContentType: (filename: any, defVal?: string) => string;

                                                                                                                                                                                          property generateRandomString

                                                                                                                                                                                          static generateRandomString: () => string;

                                                                                                                                                                                            property isEmpty

                                                                                                                                                                                            static isEmpty: (obj?: {}) => boolean;

                                                                                                                                                                                              property isStrictObject

                                                                                                                                                                                              static isStrictObject: (obj: any) => boolean;

                                                                                                                                                                                                property isTextFile

                                                                                                                                                                                                static isTextFile: (contentType: any) => boolean;

                                                                                                                                                                                                  property isWebWorker

                                                                                                                                                                                                  static isWebWorker: () => boolean;

                                                                                                                                                                                                    property makeQuerablePromise

                                                                                                                                                                                                    static makeQuerablePromise: (promise: any) => any;

                                                                                                                                                                                                      property objectLessAttributes

                                                                                                                                                                                                      static objectLessAttributes: (obj: any, less: any) => any;

                                                                                                                                                                                                        property sortByField

                                                                                                                                                                                                        static sortByField: (list: any, field: any, dir: any) => boolean;

                                                                                                                                                                                                          property transferKeyToLowerCase

                                                                                                                                                                                                          static transferKeyToLowerCase: (
                                                                                                                                                                                                          obj: any,
                                                                                                                                                                                                          whiteListForItself?: any[],
                                                                                                                                                                                                          whiteListForChildren?: any[]
                                                                                                                                                                                                          ) => any;

                                                                                                                                                                                                            property transferKeyToUpperCase

                                                                                                                                                                                                            static transferKeyToUpperCase: (
                                                                                                                                                                                                            obj: any,
                                                                                                                                                                                                            whiteListForItself?: any[],
                                                                                                                                                                                                            whiteListForChildren?: any[]
                                                                                                                                                                                                            ) => any;

                                                                                                                                                                                                              class Logger

                                                                                                                                                                                                              class ConsoleLogger implements Logger {}
                                                                                                                                                                                                              • Write logs Logger

                                                                                                                                                                                                              constructor

                                                                                                                                                                                                              constructor(name: string, level?: string);
                                                                                                                                                                                                              • Parameter name

                                                                                                                                                                                                                Name of the logger

                                                                                                                                                                                                              property level

                                                                                                                                                                                                              level: string;

                                                                                                                                                                                                                property LOG_LEVEL

                                                                                                                                                                                                                static LOG_LEVEL: any;

                                                                                                                                                                                                                  property name

                                                                                                                                                                                                                  name: string;

                                                                                                                                                                                                                    method addPluggable

                                                                                                                                                                                                                    addPluggable: (pluggable: LoggingProvider) => void;

                                                                                                                                                                                                                      method configure

                                                                                                                                                                                                                      configure: (config?: object) => object;

                                                                                                                                                                                                                        method debug

                                                                                                                                                                                                                        debug: (...msg: any[]) => void;
                                                                                                                                                                                                                        • Write DEBUG log Logger

                                                                                                                                                                                                                          Parameter msg

                                                                                                                                                                                                                          Logging message or object

                                                                                                                                                                                                                        method error

                                                                                                                                                                                                                        error: (...msg: any[]) => void;
                                                                                                                                                                                                                        • Write ERROR log Logger

                                                                                                                                                                                                                          Parameter msg

                                                                                                                                                                                                                          Logging message or object

                                                                                                                                                                                                                        method info

                                                                                                                                                                                                                        info: (...msg: any[]) => void;
                                                                                                                                                                                                                        • Write INFO log Logger

                                                                                                                                                                                                                          Parameter msg

                                                                                                                                                                                                                          Logging message or object

                                                                                                                                                                                                                        method listPluggables

                                                                                                                                                                                                                        listPluggables: () => LoggingProvider[];

                                                                                                                                                                                                                          method log

                                                                                                                                                                                                                          log: (...msg: any[]) => void;
                                                                                                                                                                                                                          • Write General log. Default to INFO Logger

                                                                                                                                                                                                                            Parameter msg

                                                                                                                                                                                                                            Logging message or object

                                                                                                                                                                                                                          method verbose

                                                                                                                                                                                                                          verbose: (...msg: any[]) => void;
                                                                                                                                                                                                                          • Write VERBOSE log Logger

                                                                                                                                                                                                                            Parameter msg

                                                                                                                                                                                                                            Logging message or object

                                                                                                                                                                                                                          method warn

                                                                                                                                                                                                                          warn: (...msg: any[]) => void;
                                                                                                                                                                                                                          • Write WARN log Logger

                                                                                                                                                                                                                            Parameter msg

                                                                                                                                                                                                                            Logging message or object

                                                                                                                                                                                                                          class MemoryStorage

                                                                                                                                                                                                                          class MemoryStorage {}

                                                                                                                                                                                                                          method clear

                                                                                                                                                                                                                          static clear: () => {};
                                                                                                                                                                                                                          • This is used to clear the storage

                                                                                                                                                                                                                            Returns

                                                                                                                                                                                                                            {string} nothing

                                                                                                                                                                                                                          method getItem

                                                                                                                                                                                                                          static getItem: (key: string) => any;
                                                                                                                                                                                                                          • This is used to get a specific key from storage

                                                                                                                                                                                                                            Parameter key

                                                                                                                                                                                                                            the key for the item This is used to clear the storage

                                                                                                                                                                                                                            Returns

                                                                                                                                                                                                                            {string} the data item

                                                                                                                                                                                                                          method removeItem

                                                                                                                                                                                                                          static removeItem: (key: string) => boolean;
                                                                                                                                                                                                                          • This is used to remove an item from storage

                                                                                                                                                                                                                            Parameter key

                                                                                                                                                                                                                            the key being set

                                                                                                                                                                                                                            Returns

                                                                                                                                                                                                                            {string} value - value that was deleted

                                                                                                                                                                                                                          method setItem

                                                                                                                                                                                                                          static setItem: (key: string, value: any) => any;
                                                                                                                                                                                                                          • This is used to set a specific item in storage

                                                                                                                                                                                                                            Parameter key

                                                                                                                                                                                                                            the key for the item

                                                                                                                                                                                                                            Parameter value

                                                                                                                                                                                                                            the value

                                                                                                                                                                                                                            Returns

                                                                                                                                                                                                                            {string} value that was set

                                                                                                                                                                                                                          class Mutex

                                                                                                                                                                                                                          class Mutex implements MutexInterface {}

                                                                                                                                                                                                                            method acquire

                                                                                                                                                                                                                            acquire: () => Promise<MutexInterface.Releaser>;

                                                                                                                                                                                                                              method isLocked

                                                                                                                                                                                                                              isLocked: () => boolean;

                                                                                                                                                                                                                                method runExclusive

                                                                                                                                                                                                                                runExclusive: <T>(callback: MutexInterface.Worker<T>) => Promise<T>;

                                                                                                                                                                                                                                  class NonRetryableError

                                                                                                                                                                                                                                  class NonRetryableError extends Error {}

                                                                                                                                                                                                                                    constructor

                                                                                                                                                                                                                                    constructor(message: string);

                                                                                                                                                                                                                                      property nonRetryable

                                                                                                                                                                                                                                      readonly nonRetryable: boolean;

                                                                                                                                                                                                                                        class Parser

                                                                                                                                                                                                                                        class Parser {}
                                                                                                                                                                                                                                        • Deprecated

                                                                                                                                                                                                                                          use per-function export

                                                                                                                                                                                                                                        property parseMobilehubConfig

                                                                                                                                                                                                                                        static parseMobilehubConfig: (config: any) => AmplifyConfig;

                                                                                                                                                                                                                                          class Reachability

                                                                                                                                                                                                                                          class ReachabilityNavigator implements Reachability {}

                                                                                                                                                                                                                                            method networkMonitor

                                                                                                                                                                                                                                            networkMonitor: (netInfo?: any) => any;

                                                                                                                                                                                                                                              class ServiceWorker

                                                                                                                                                                                                                                              class ServiceWorkerClass {}
                                                                                                                                                                                                                                              • Provides a means to registering a service worker in the browser and communicating with it via postMessage events. https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API/

                                                                                                                                                                                                                                                postMessage events are currently not supported in all browsers. See: https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API

                                                                                                                                                                                                                                                At the minmum this class will register the service worker and listen and attempt to dispatch messages on state change and record analytics events based on the service worker lifecycle.

                                                                                                                                                                                                                                              constructor

                                                                                                                                                                                                                                              constructor();

                                                                                                                                                                                                                                                property serviceWorker

                                                                                                                                                                                                                                                readonly serviceWorker: ServiceWorker;
                                                                                                                                                                                                                                                • Get the currently active service worker

                                                                                                                                                                                                                                                method enablePush

                                                                                                                                                                                                                                                enablePush: (publicKey: string) => Promise<unknown>;
                                                                                                                                                                                                                                                • Enable web push notifications. If not subscribed, a new subscription will be created and registered. Test Push Server: https://web-push-codelab.glitch.me/ Push Server Libraries: https://github.com/web-push-libs/ API Doc: https://developers.google.com/web/fundamentals/codelabs/push-notifications/

                                                                                                                                                                                                                                                  Parameter publicKey

                                                                                                                                                                                                                                                  Returns

                                                                                                                                                                                                                                                  {Promise} - resolve(PushSubscription) - reject(Error)

                                                                                                                                                                                                                                                method register

                                                                                                                                                                                                                                                register: (filePath?: string, scope?: string) => Promise<unknown>;
                                                                                                                                                                                                                                                • Register the service-worker.js file in the browser Make sure the service-worker.js is part of the build for example with Angular, modify the angular-cli.json file and add to "assets" array "service-worker.js"

                                                                                                                                                                                                                                                  Parameter

                                                                                                                                                                                                                                                  {string} - (optional) Service worker file. Defaults to "/service-worker.js"

                                                                                                                                                                                                                                                  Parameter

                                                                                                                                                                                                                                                  {string} - (optional) The service worker scope. Defaults to "/" - API Doc: https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerContainer/register

                                                                                                                                                                                                                                                  Returns

                                                                                                                                                                                                                                                  {Promise} - resolve(ServiceWorkerRegistration) - reject(Error)

                                                                                                                                                                                                                                                method send

                                                                                                                                                                                                                                                send: (message: object | string) => void;
                                                                                                                                                                                                                                                • Send a message to the service worker. The service worker needs to implement `self.addEventListener('message') to handle the message. This ***currently*** does not work in Safari or IE.

                                                                                                                                                                                                                                                  Parameter

                                                                                                                                                                                                                                                  {object | string} - An arbitrary JSON object or string message to send to the service worker - see: https://developer.mozilla.org/en-US/docs/Web/API/Transferable

                                                                                                                                                                                                                                                  Returns

                                                                                                                                                                                                                                                  {Promise}

                                                                                                                                                                                                                                                class Signer

                                                                                                                                                                                                                                                class Signer {}

                                                                                                                                                                                                                                                  method sign

                                                                                                                                                                                                                                                  static sign: (request: any, access_info: any, service_info?: any) => any;
                                                                                                                                                                                                                                                  • Sign a HTTP request, add 'Authorization' header to request param sign Signer

                                                                                                                                                                                                                                                    Parameter request

                                                                                                                                                                                                                                                    HTTP request object request: { method: GET | POST | PUT ... url: ..., headers: { header1: ... }, data: data }

                                                                                                                                                                                                                                                    Parameter access_info

                                                                                                                                                                                                                                                    AWS access credential info access_info: { access_key: ..., secret_key: ..., session_token: ... }

                                                                                                                                                                                                                                                    Parameter service_info

                                                                                                                                                                                                                                                    AWS service type and region, optional, if not provided then parse out from url service_info: { service: ..., region: ... }

                                                                                                                                                                                                                                                    Returns

                                                                                                                                                                                                                                                    {object} Signed HTTP request

                                                                                                                                                                                                                                                  method signUrl

                                                                                                                                                                                                                                                  static signUrl: {
                                                                                                                                                                                                                                                  (
                                                                                                                                                                                                                                                  urlToSign: string,
                                                                                                                                                                                                                                                  accessInfo: any,
                                                                                                                                                                                                                                                  serviceInfo?: any,
                                                                                                                                                                                                                                                  expiration?: number
                                                                                                                                                                                                                                                  ): string;
                                                                                                                                                                                                                                                  (
                                                                                                                                                                                                                                                  request: any,
                                                                                                                                                                                                                                                  accessInfo: any,
                                                                                                                                                                                                                                                  serviceInfo?: any,
                                                                                                                                                                                                                                                  expiration?: number
                                                                                                                                                                                                                                                  ): string;
                                                                                                                                                                                                                                                  };

                                                                                                                                                                                                                                                    class StorageHelper

                                                                                                                                                                                                                                                    class StorageHelper {}

                                                                                                                                                                                                                                                      constructor

                                                                                                                                                                                                                                                      constructor();
                                                                                                                                                                                                                                                      • This is used to get a storage object

                                                                                                                                                                                                                                                        Returns

                                                                                                                                                                                                                                                        {object} the storage

                                                                                                                                                                                                                                                      method getStorage

                                                                                                                                                                                                                                                      getStorage: () => any;
                                                                                                                                                                                                                                                      • This is used to return the storage

                                                                                                                                                                                                                                                        Returns

                                                                                                                                                                                                                                                        {object} the storage

                                                                                                                                                                                                                                                      class UniversalStorage

                                                                                                                                                                                                                                                      class UniversalStorage implements Storage {}

                                                                                                                                                                                                                                                        constructor

                                                                                                                                                                                                                                                        constructor(context?: Context);

                                                                                                                                                                                                                                                          property cookies

                                                                                                                                                                                                                                                          cookies: any;

                                                                                                                                                                                                                                                            property length

                                                                                                                                                                                                                                                            readonly length: number;

                                                                                                                                                                                                                                                              property store

                                                                                                                                                                                                                                                              store: Store;

                                                                                                                                                                                                                                                                method clear

                                                                                                                                                                                                                                                                clear: () => void;

                                                                                                                                                                                                                                                                  method getItem

                                                                                                                                                                                                                                                                  getItem: (key: keyof Store) => string;

                                                                                                                                                                                                                                                                    method getLocalItem

                                                                                                                                                                                                                                                                    protected getLocalItem: (key: keyof Store) => string;

                                                                                                                                                                                                                                                                      method getUniversalItem

                                                                                                                                                                                                                                                                      protected getUniversalItem: (key: keyof Store) => any;

                                                                                                                                                                                                                                                                        method key

                                                                                                                                                                                                                                                                        key: (index: number) => string;

                                                                                                                                                                                                                                                                          method removeItem

                                                                                                                                                                                                                                                                          removeItem: (key: string) => void;

                                                                                                                                                                                                                                                                            method removeLocalItem

                                                                                                                                                                                                                                                                            protected removeLocalItem: (key: keyof Store) => void;

                                                                                                                                                                                                                                                                              method removeUniversalItem

                                                                                                                                                                                                                                                                              protected removeUniversalItem: (key: keyof Store) => void;

                                                                                                                                                                                                                                                                                method setItem

                                                                                                                                                                                                                                                                                setItem: (key: keyof Store, value: string) => void;

                                                                                                                                                                                                                                                                                  method setLocalItem

                                                                                                                                                                                                                                                                                  protected setLocalItem: (key: keyof Store, value: string) => void;

                                                                                                                                                                                                                                                                                    method setUniversalItem

                                                                                                                                                                                                                                                                                    protected setUniversalItem: (key: keyof Store, value: string) => void;

                                                                                                                                                                                                                                                                                      Interfaces

                                                                                                                                                                                                                                                                                      interface ICredentials

                                                                                                                                                                                                                                                                                      interface ICredentials {}

                                                                                                                                                                                                                                                                                        property accessKeyId

                                                                                                                                                                                                                                                                                        accessKeyId: string;

                                                                                                                                                                                                                                                                                          property authenticated

                                                                                                                                                                                                                                                                                          authenticated: boolean;

                                                                                                                                                                                                                                                                                            property expiration

                                                                                                                                                                                                                                                                                            expiration?: Date;

                                                                                                                                                                                                                                                                                              property identityId

                                                                                                                                                                                                                                                                                              identityId: string;

                                                                                                                                                                                                                                                                                                property secretAccessKey

                                                                                                                                                                                                                                                                                                secretAccessKey: string;

                                                                                                                                                                                                                                                                                                  property sessionToken

                                                                                                                                                                                                                                                                                                  sessionToken: string;

                                                                                                                                                                                                                                                                                                    Type Aliases

                                                                                                                                                                                                                                                                                                    type HubCallback

                                                                                                                                                                                                                                                                                                    type HubCallback = (capsule: HubCapsule) => void;

                                                                                                                                                                                                                                                                                                      type HubCapsule

                                                                                                                                                                                                                                                                                                      type HubCapsule = {
                                                                                                                                                                                                                                                                                                      channel: string;
                                                                                                                                                                                                                                                                                                      payload: HubPayload;
                                                                                                                                                                                                                                                                                                      source: string;
                                                                                                                                                                                                                                                                                                      patternInfo?: string[];
                                                                                                                                                                                                                                                                                                      };

                                                                                                                                                                                                                                                                                                        type HubPayload

                                                                                                                                                                                                                                                                                                        type HubPayload = {
                                                                                                                                                                                                                                                                                                        event: string;
                                                                                                                                                                                                                                                                                                        data?: any;
                                                                                                                                                                                                                                                                                                        message?: string;
                                                                                                                                                                                                                                                                                                        };

                                                                                                                                                                                                                                                                                                          Namespaces

                                                                                                                                                                                                                                                                                                          namespace *.json

                                                                                                                                                                                                                                                                                                          module '*.json' {}

                                                                                                                                                                                                                                                                                                            variable version

                                                                                                                                                                                                                                                                                                            const version: any;

                                                                                                                                                                                                                                                                                                              Package Files (27)

                                                                                                                                                                                                                                                                                                              Dependencies (8)

                                                                                                                                                                                                                                                                                                              Dev Dependencies (5)

                                                                                                                                                                                                                                                                                                              Peer Dependencies (0)

                                                                                                                                                                                                                                                                                                              No peer dependencies.

                                                                                                                                                                                                                                                                                                              Badge

                                                                                                                                                                                                                                                                                                              To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                                                                                                                                                                                                                                                                              You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@aws-amplify/core.

                                                                                                                                                                                                                                                                                                              • Markdown
                                                                                                                                                                                                                                                                                                                [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@aws-amplify/core)
                                                                                                                                                                                                                                                                                                              • HTML
                                                                                                                                                                                                                                                                                                                <a href="https://www.jsdocs.io/package/@aws-amplify/core"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>