Options
All
  • Public
  • Public/Protected
  • All
Menu

A library that can be used with p5.js sketches.

Hierarchy

  • Library

Implements

Index

Methods

  • addFromJsonFile(jsonPath: string, defaultProps: Partial<Properties>): readonly Library[]
  • Adds all the libraries in the given library specification JSON file to the global library array Library.all.

    Parameters

    Returns readonly Library[]

  • find(__namedParameters: { importPath?: string; name?: string; packageName?: string }): null | Library
  • Find a library by its name or import path.

    Parameters

    • __namedParameters: { importPath?: string; name?: string; packageName?: string }
      • Optional importPath?: string
      • Optional name?: string
      • Optional packageName?: string

    Returns null | Library

  • fromPackageName(packageName: string): Library
  • fromProperties(props: Properties, __namedParameters?: { ifExists?: "replace" | "error" }): Library
  • Adds a library from a record in a library.json file.

    Parameters

    • props: Properties
    • __namedParameters: { ifExists?: "replace" | "error" } = {}
      • Optional ifExists?: "replace" | "error"

    Returns Library

  • fromUrl(importPath: string): Library
  • inferFromScripts(scriptPaths: string[], __namedParameters?: { ifNotExists: undefined | string }): readonly Library[]
  • Parameters

    • scriptPaths: string[]
    • __namedParameters: { ifNotExists: undefined | string } = {}
      • ifNotExists: undefined | string

    Returns readonly Library[]

  • toJSON(): unknown

Accessors

  • get globals(): readonly string[]
  • get importPath(): undefined | string
  • set importPath(value: undefined | string): void
  • A path that can be used to load the library.

    Returns undefined | string

  • A path that can be used to load the library.

    Parameters

    • value: undefined | string

    Returns void

  • get repositoryUrl(): null | string

Properties

categoryKey?: string
defines?: Record<"p5" | "globals", string[]>

Global variables (functions and classes) and p5.* properties that the library defines.

description: string

The human-readable description of the library.

homepage: string

The library's home page.

name: string

The human-readable name of the library.

packageName?: string

The npm package name of the library.

repository?: string

Generated using TypeDoc