@cds/core
Version:
Clarity Design System - common components, themes, and utilties
34 lines (33 loc) • 1.45 kB
TypeScript
import { PropertyDeclaration } from 'lit';
export interface CustomPropertyConfig {
type: unknown;
required?: 'error' | 'warning';
requiredMessage?: string;
}
export declare type PropertyConfig = PropertyDeclaration<unknown, unknown> & CustomPropertyConfig;
/**
* https://developers.google.com/web/fundamentals/web-components/best-practices
*/
export declare function getDefaultOptions(propertyKey: string, options?: PropertyConfig): PropertyDeclaration;
export declare function requirePropertyCheck(protoOrDescriptor: any, name: string, options?: PropertyConfig): void;
/**
* lit @property decorator with custom defaults specific to Clarity.
* https://lit.dev/docs/components/properties/
*
* A property decorator which creates a LitElement property which reflects a
* corresponding attribute value. A PropertyDeclaration may optionally be
* supplied to configure property features.
*
* @ExportDecoratedItems
*/
export declare function property(options?: PropertyConfig): (protoOrDescriptor: any, name?: PropertyKey | undefined) => any;
/**
* lit @state decorator with custom defaults specific to Clarity.
*
* This is used for communication between internal component properties
* that are not exposed as part of the public component API.
* https://lit.dev/docs/api/decorators/#state
*
* @ExportDecoratedItems
*/
export declare function state(options?: PropertyConfig): (protoOrDescriptor: any, name: string) => any;