reactotron-core-client

  • Version 2.8.10
  • Published
  • 41 kB
  • No dependencies
  • MIT license

Install

npm i reactotron-core-client
yarn add reactotron-core-client
pnpm add reactotron-core-client

Overview

Grants Reactotron clients the ability to talk to a Reactotron server.

Index

Variables

variable corePlugins

const corePlugins: (
| ((
reactotron: Reactotron<ReactotronCore>
) => {
features: {
log: (...args: any[]) => void;
logImportant: (...args: any[]) => void;
debug: (message: any, important?: boolean) => void;
warn: (message: any) => void;
error: (message: any, stack: any) => void;
};
})
| ((
reactotron: Reactotron<ReactotronCore>
) => {
features: {
image: ({
uri,
preview,
filename,
width,
height,
caption,
}: {
uri: any;
preview: any;
filename: any;
width: any;
height: any;
caption: any;
}) => void;
};
})
| ((
reactotron: Reactotron<ReactotronCore>
) => {
features: {
benchmark: (
title: any
) => {
step: (stepTitle: any) => void;
stop: (stopTitle: any) => void;
last: (stopTitle: any) => void;
};
};
})
| ((
reactotron: Reactotron<ReactotronCore>
) => {
features: {
stateActionComplete: (
name: any,
action: any,
important?: boolean
) => void;
stateValuesResponse: (path: any, value: any, valid?: boolean) => void;
stateKeysResponse: (path: any, keys: any, valid?: boolean) => void;
stateValuesChange: (changes: any) => void;
stateBackupResponse: (state: any) => void;
};
})
| ((
reactotron: Reactotron<ReactotronCore>
) => {
features: {
apiResponse: (request: any, response: any, duration: any) => void;
};
})
| ((
reactotron: Reactotron<ReactotronCore>
) => { features: { clear: () => void } })
| ((
reactotron: Reactotron<ReactotronCore>
) => {
onCommand: ({ type, payload }: { type: string; payload?: any }) => void;
features: {
repl: (
name: string,
value: import('./plugins/repl').AcceptableRepls
) => void;
};
})
)[];

    Functions

    function createClient

    createClient: <ReactotronSubtype = ReactotronCore>(
    options?: ClientOptions
    ) => Reactotron<ReactotronSubtype> & ReactotronSubtype;

      Classes

      class ReactotronImpl

      class ReactotronImpl<ReactotronSubtype = ReactotronCore>
      implements Reactotron<ReactotronSubtype> {}

        property connected

        connected: boolean;
        • Are we connected to a server?

        property customCommandLatestId

        customCommandLatestId: number;
        • The current ID for custom commands

        property customCommands

        customCommands: CustomCommand[];
        • The registered custom commands

        property isReady

        isReady: boolean;
        • Are we ready to start communicating?

        property lastMessageDate

        lastMessageDate: Date;
        • The last time we sent a message.

        property options

        options: ClientOptions;

          property plugins

          plugins: any[];
          • Available plugins.

          property send

          send: (type: any, payload?: {}, important?: boolean) => void;
          • Sends a command to the server

          property sendQueue

          sendQueue: any[];
          • Messages that need to be sent.

          property socket

          socket: any;
          • The socket we're using.

          property startTimer

          startTimer: () => () => number;
          • Starts a timer and returns a function you can call to stop it and return the elapsed time.

          method close

          close: () => void;

            method configure

            configure: (
            options?: ClientOptions
            ) => Reactotron<ReactotronSubtype> & ReactotronSubtype;
            • Set the configuration options.

            method connect

            connect: () => Reactotron<ReactotronSubtype> & ReactotronSubtype;
            • Connect to the Reactotron server.

            method display

            display: (config?: any) => void;
            • Sends a custom command to the server to displays nicely.

            method onCustomCommand

            onCustomCommand: (
            config: CustomCommand | string,
            optHandler?: () => void
            ) => () => void;

              method reportError

              reportError: (this: any, error: any) => void;
              • Client libraries can hijack this to report errors.

              method use

              use: (
              pluginCreator?: (
              client: Reactotron<ReactotronSubtype> & ReactotronSubtype
              ) => any
              ) => Reactotron<ReactotronSubtype> & ReactotronSubtype;
              • Adds a plugin to the system

              Interfaces

              interface CustomCommand

              interface CustomCommand {}

                property args

                args?: CustomCommandArg[];

                  property command

                  command: string;

                    property description

                    description?: string;

                      property handler

                      handler: (args?: any) => void;

                        property id

                        id?: number;

                          property title

                          title?: string;

                            interface CustomCommandArg

                            interface CustomCommandArg {}

                              property name

                              name: string;

                                property type

                                type: ArgType;

                                  interface Reactotron

                                  interface Reactotron<ReactotronSubtype = ReactotronCore> extends ReactotronCore {}

                                    property configure

                                    configure: (
                                    options?: ClientOptions
                                    ) => Reactotron<ReactotronSubtype> & ReactotronSubtype;
                                    • Set the configuration options.

                                    property connect

                                    connect: () => Reactotron<ReactotronSubtype> & ReactotronSubtype;

                                      property use

                                      use: (
                                      pluginCreator?: (
                                      client: Reactotron<ReactotronSubtype> & ReactotronSubtype
                                      ) => any
                                      ) => Reactotron<ReactotronSubtype> & ReactotronSubtype;

                                        interface ReactotronCore

                                        interface ReactotronCore {}

                                          property apiResponse

                                          apiResponse?: (request: any, response: any, duration: any) => void;

                                            property benchmark

                                            benchmark?: (
                                            title: string
                                            ) => {
                                            step: (stepName: string) => void;
                                            stop: (stopTitle: string) => void;
                                            last: (stopTitle: string) => void;
                                            };

                                              property clear

                                              clear?: () => void;

                                                property close

                                                close: () => void;

                                                  property debug

                                                  debug?: (message: any, important?: boolean) => void;

                                                    property display

                                                    display: (config?: any) => void;

                                                      property error

                                                      error?: (message: any, stack: any) => void;

                                                        property image

                                                        image?: (options: {
                                                        uri: any;
                                                        preview: any;
                                                        filename: any;
                                                        width: any;
                                                        height: any;
                                                        caption: any;
                                                        }) => void;

                                                          property log

                                                          log?: (...args: any[]) => void;

                                                            property logImportant

                                                            logImportant?: (...args: any[]) => void;

                                                              property onCustomCommand

                                                              onCustomCommand: (
                                                              config: CustomCommand | string,
                                                              optHandler?: () => void
                                                              ) => () => void;

                                                                property repl

                                                                repl?: (name: string, value: object | Function | string | number) => void;

                                                                  property reportError

                                                                  reportError: (this: any, error: any) => void;

                                                                    property send

                                                                    send: (type: any, payload?: any, important?: boolean) => void;

                                                                      property startTimer

                                                                      startTimer: () => () => number;

                                                                        property stateActionComplete

                                                                        stateActionComplete?: (name: any, action: any, important?: boolean) => void;

                                                                          property stateBackupResponse

                                                                          stateBackupResponse?: (state: any) => void;

                                                                            property stateKeysResponse

                                                                            stateKeysResponse?: (path: any, keys: any, valid?: boolean) => void;

                                                                              property stateValuesChange

                                                                              stateValuesChange?: (changes: any) => void;

                                                                                property stateValuesResponse

                                                                                stateValuesResponse?: (path: any, value: any, valid?: boolean) => void;

                                                                                  property warn

                                                                                  warn?: (message: any) => void;

                                                                                    Enums

                                                                                    enum ArgType

                                                                                    enum ArgType {
                                                                                    String = 'string',
                                                                                    }

                                                                                      member String

                                                                                      String = 'string'

                                                                                        Package Files (1)

                                                                                        Dependencies (0)

                                                                                        No dependencies.

                                                                                        Dev Dependencies (35)

                                                                                        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/reactotron-core-client.

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