UNPKG

dcl-ui-toolkit

Version:

A collection of UI helpers to make it easier to build a Decentraland scene using the SDK 7.

39 lines (38 loc) 1.56 kB
import ReactEcs from '@dcl/sdk/react-ecs'; import { EntityPropTypes } from '@dcl/react-ecs/dist/components/types'; import { UiLabelProps } from '@dcl/react-ecs/dist/components/Label/types'; import { InPromptUIObject, InPromptUIObjectConfig } from '../../InPromptUIObject'; export type PromptCheckboxLabelElementProps = EntityPropTypes & Omit<UiLabelProps, 'value'>; export type PromptCheckboxImageElementProps = Omit<EntityPropTypes, 'uiTransform' | 'uiBackground'> & { uiTransform?: Omit<NonNullable<EntityPropTypes['uiTransform']>, 'width' | 'height'>; uiBackground?: Omit<NonNullable<EntityPropTypes['uiBackground']>, 'uvs'>; }; export type PromptCheckboxConfig = InPromptUIObjectConfig & { text: string | number; xPosition: number; yPosition: number; onCheck?: () => void; onUncheck?: () => void; large?: boolean; startChecked?: boolean; }; export declare class PromptCheckbox extends InPromptUIObject { imageElement: PromptCheckboxImageElementProps; labelElement: PromptCheckboxLabelElementProps; text: string | number; xPosition: number; yPosition: number; large: boolean; startChecked: boolean; onUncheck: () => void; onCheck: () => void; private _checked; private _xPosition; private _yPosition; constructor({ parent, startHidden, text, xPosition, yPosition, large, startChecked, onUncheck, onCheck, }: PromptCheckboxConfig); uncheck(): void; check(): void; render(key?: string): ReactEcs.JSX.Element; private _getImageStyle; private _click; }