Options
All
  • Public
  • Public/Protected
  • All
Menu

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

Hierarchy

  • Library

Implements

Index

Methods

Static addFromJsonFile

  • 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[]

Static find

  • 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

Static fromPackageName

  • fromPackageName(packageName: string): Library

Static fromProperties

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

    Parameters

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

    Returns Library

Static fromUrl

  • fromUrl(importPath: string): Library

Static inferFromScripts

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

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

    Returns readonly Library[]

toJSON

  • toJSON(): unknown

Accessors

Static all

Static categories

globals

  • get globals(): readonly string[]

importPath

  • 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

repositoryUrl

  • get repositoryUrl(): null | string

Properties

Optional Readonly categoryKey

categoryKey?: string

Optional Readonly defines

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

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

Readonly description

description: string

The human-readable description of the library.

Readonly homepage

homepage: string

The library's home page.

Readonly name

name: string

The human-readable name of the library.

Optional Readonly packageName

packageName?: string

The npm package name of the library.

Optional Readonly repository

repository?: string

Generated using TypeDoc