Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "pluginAdder"

Index

Variables

Const addedPlugins

addedPlugins: string[] = []

Const track

track: { className: string; desc?: undefined | string; isStatic: boolean; methodName: string; pluginName: string }[] = []

Functions

addPlugin

  • addPlugin(pluginWrapper: Plugin, allowPluginOverwrite?: boolean, ignoreIfAlreadyLoaded?: boolean): void
  • adds plugins to the core library plugins is a way to add methods to the core class like File, Dir, etc...

    example
    addPlugin({
      name: "xml",
      plugin: [
        {
          methodName: "xml",
          func: function(compact: boolean = true, spaces: number = 2) {
            return xmlJs.xml2json(this.read(), { compact, spaces });
          },
          className: "File",
          isStatic: false
        }]
     });

    Parameters

    • pluginWrapper: Plugin

      the plugin

    • Default value allowPluginOverwrite: boolean = false

      if true will allow provided plugin to overwrite any method added by any plugin

    • Default value ignoreIfAlreadyLoaded: boolean = false

    Returns void

checkIfOverwrites

  • checkIfOverwrites(element: Plugin["plugin"][0], pluginName: string): number
  • Parameters

    • element: Plugin["plugin"][0]
    • pluginName: string

    Returns number

getMethods

  • getMethods(cl: any): string[]

getPluginTrack

  • getPluginTrack(): { className: string; desc?: undefined | string; isStatic: boolean; methodName: string; pluginName: string }[]
  • returns a track of added methods

    Returns { className: string; desc?: undefined | string; isStatic: boolean; methodName: string; pluginName: string }[]

getPluginTrackFormatted

  • getPluginTrackFormatted(sort?: undefined | false | true): { methods: { className: string; desc?: undefined | string; isStatic: boolean; methodName: string }[]; name: string }[]
  • returns a track of added plugin

    Parameters

    • Optional sort: undefined | false | true

      sort the plugins methods if sort is true the methods will be sorted as following

      static method for File then non-static methods for File then the same for Dir then Shape

    Returns { methods: { className: string; desc?: undefined | string; isStatic: boolean; methodName: string }[]; name: string }[]

getStaticMethods

  • getStaticMethods(cl: any): string[]

Object literals

Const index

index: object

Dir

Dir: any

File

File: any

Shape

Shape: any

Const native_methods

native_methods: object

Dir

Dir: object

inst

inst: string[] = getMethods(index.Dir)

static

static: string[] = getStaticMethods(index.Dir)

File

File: object

inst

inst: string[] = getMethods(index.File)

static

static: string[] = getStaticMethods(index.File)

Shape

Shape: object

inst

inst: string[] = getMethods(index.Shape)

static

static: string[] = getStaticMethods(index.Shape)

Generated using TypeDoc