@hashicorp/design-system-components
Version:
Helios Design System Components
41 lines (40 loc) • 1.26 kB
TypeScript
/**
* Copyright IBM Corp. 2021, 2025
* SPDX-License-Identifier: MPL-2.0
*/
import Component from '@glimmer/component';
import type { HdsTextBodySignature } from '../../text/body';
export interface HdsFormCharacterCountSignature {
Args: {
contextualClass?: string;
controlId?: string;
maxLength?: number | string;
minLength?: number | string;
onInsert?: (element: HTMLElement, ...args: any[]) => void;
value?: string;
};
Blocks: {
default?: [
{
minLength?: number;
maxLength?: number;
currentLength?: number;
remaining?: number;
shortfall?: number;
}
];
};
Element: HdsTextBodySignature['Element'];
}
export default class HdsFormCharacterCount extends Component<HdsFormCharacterCountSignature> {
get currentLength(): number;
private _pluralize;
get maxLength(): number | undefined;
get minLength(): number | undefined;
get remaining(): number | undefined;
get shortfall(): number | undefined;
get message(): string;
get id(): string | null;
get onInsert(): (element: HTMLElement, ...args: any[]) => void;
get classNames(): string;
}