tgui-angular
Version:
🚀 Angular UI library for Telegram Web Apps with modern components and theming support | 💼 Author is open to work opportunities | 📧 Contact: a.blagovestnov@gmail.com | 💬 Telegram: @ablagovestnov
37 lines (36 loc) • 1.26 kB
TypeScript
import * as i0 from "@angular/core";
export interface UsePinInputParams {
pinCount: number;
value?: number[];
onChange?: (value: number[]) => void;
}
/**
* Keys for keyboard accessibility
*/
export declare enum Keys {
BACKSPACE = "Backspace",
ARROW_LEFT = "ArrowLeft",
ARROW_RIGHT = "ArrowRight"
}
export declare const AVAILABLE_PINS: (number | Keys)[];
/**
* Service that provides functionality for PIN input component
* Similar to the React usePinInput hook
*/
export declare class PinInputService {
constructor();
/**
* Creates a PIN input controller with the specified parameters
* @param params The parameters for the PIN input
* @returns An object with methods and signals for controlling the PIN input
*/
create(params: UsePinInputParams): {
value: import("@angular/core").WritableSignal<number[]>;
setInputRefByIndex: (index: number, ref: HTMLLabelElement | null) => void;
handleClickValue: (enteredValue: number) => void;
handleClickBackspace: () => void;
handleButton: (index: number, button: string) => void;
};
static ɵfac: i0.ɵɵFactoryDeclaration<PinInputService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<PinInputService>;
}