@sandlada/mdc
Version:
@sandlada/mdc is an open source component library that follows the Material Design 3 design specifications.
36 lines • 1 kB
TypeScript
/**
* @license
* Copyright 2023 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { Validator } from './validator.js';
/**
* Constraint validation properties for a checkbox.
*/
export interface ICheckboxState {
/**
* Whether the checkbox is checked.
*/
readonly checked: boolean;
/**
* Whether the checkbox is required.
*/
readonly required: boolean;
}
/**
* A validator that provides constraint validation that emulates
* `<input type="checkbox">` validation.
*/
export declare class CheckboxValidator extends Validator<ICheckboxState> {
private checkboxControl?;
protected computeValidity(state: ICheckboxState): {
validity: ValidityState;
validationMessage: string;
};
protected equals(prev: ICheckboxState, next: ICheckboxState): boolean;
protected copy({ checked, required }: ICheckboxState): {
checked: boolean;
required: boolean;
};
}
//# sourceMappingURL=checkbox-validator.d.ts.map