Options
All
  • Public
  • Public/Protected
  • All
Menu

Package yarnpkg-libui

@yarnpkg/libui

This library is used to power parts of the UI in our interactive plugins.

Components

Application

A component that setups the state.

<ScrollableItems size={number} children={ReactEle}/>

A scrollable container which will display at most 2 * size + 1 lines of result on screen and will watch the up and down keys to scroll.

Note: The current implementation only supports children with an explicit key parameter and a height of exactly 1 row.

Hooks

useListItems

A key listener that watches for two keys (configurable through minus and plus) and triggers the set callback when either of them is pressed.

Type aliases

FocusRequestHandler

FocusRequestHandler: function

Type declaration

InferProps

InferProps<T>: T extends React.ComponentType<infer P> ? P : never

Type parameters

  • T: React.ComponentType

RenderFormOptions

RenderFormOptions: object

Type declaration

SubmitInjectedComponent

SubmitInjectedComponent<T, C>: React.ComponentType<InferProps<C> & object>

Type parameters

  • T

  • C: React.ComponentType

WillReachEnd

WillReachEnd: function

Type declaration

    • (): void
    • Returns void

Variables

Const Gem

Gem: React.FC<GemProps> = memo(({active}) => {const text = useMemo(() => active ? `◉` : `◯`, [active]);const color = useMemo(() => active ? `green` : `yellow`, [active]);return <Text color={color}>{text}</Text>;})

Const MinistoreContext

MinistoreContext: Context<null | object> = React.createContext<{getAll: () => Map<string, any>;get: (key: string) => any;set: (key: string, value: any) => void;} | null>(null)

Functions

Const Application

  • Application(__namedParameters: object): Element

Const ItemOptions

  • ItemOptions<T>(__namedParameters: object): Element

Const Pad

  • Pad(__namedParameters: object): null | Element

Const ScrollableItems

  • ScrollableItems(__namedParameters: object): Element

renderForm

Const useFocusRequest

  • useFocusRequest(__namedParameters: object, handler: FocusRequestHandler, deps: Array<any>): void

useKeypress

  • useKeypress(__namedParameters: object, cb: function, deps: Array<any>): void

Const useListInput

  • useListInput<T>(value: unknown, values: Array<T>, __namedParameters: object): void
  • Type parameters

    • T

    Parameters

    • value: unknown
    • values: Array<T>
    • __namedParameters: object
      • active: boolean
      • loop: boolean
      • minus: string
      • plus: string
      • set: function
          • (value: T): void
          • Parameters

            • value: T

            Returns void

    Returns void

useMinistore

  • useMinistore<T>(): Map<string, T>
  • useMinistore<T>(key: string, initialValue: T): []

Generated using TypeDoc