Skip to main content
Glama
deleonio
by deleonio
button-callbacks.ts936 B
import type { Callback } from '../enums'; import type { EventCallback, EventValueOrEventCallback } from '../types/callbacks'; import type { StencilUnknown } from '../types/unknown'; import { watchValidator } from '../utils'; import type { Generic } from 'adopted-style-sheets'; /* types */ export type ButtonCallbacksPropType<T> = { [Callback.onClick]?: EventValueOrEventCallback<MouseEvent, T>; [Callback.onMouseDown]?: EventCallback<MouseEvent>; }; /** * Defines the callback functions for button events. */ export type PropButtonCallbacks<T> = { on: ButtonCallbacksPropType<T>; }; /* validator */ export const validateButtonCallbacks = (component: Generic.Element.Component, value?: ButtonCallbacksPropType<StencilUnknown>): void => { watchValidator( component, `_on`, (value) => typeof value === 'object' && value !== null, new Set(['ButtonCallbacksPropType {Events.onClick, Events.onMouseDown}']), value, ); };

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/deleonio/public-ui-kolibri'

If you have feedback or need assistance with the MCP directory API, please join our Discord server