diff --git a/types/cleave.js/cleave.js-tests.tsx b/types/cleave.js/cleave.js-tests.tsx index 3bbc6570a3..825b44a2ad 100644 --- a/types/cleave.js/cleave.js-tests.tsx +++ b/types/cleave.js/cleave.js-tests.tsx @@ -3,7 +3,12 @@ import Cleave = require("cleave.js"); import CleaveReact = require("cleave.js/react"); const Example1 = () => { - Cleave("#my-input", { phone: true }); + const cleave = new Cleave("#my-input", { phone: true }); + cleave.setPhoneRegionCode("AT"); + cleave.setRawValue("foo"); + const foo: string = cleave.getFormattedValue(); + const bar: string = cleave.getRawValue(); + cleave.destroy(); }; const ExampleReact1 = (props: any) => { diff --git a/types/cleave.js/index.d.ts b/types/cleave.js/index.d.ts index 17e8c1c512..27fe7d8c41 100644 --- a/types/cleave.js/index.d.ts +++ b/types/cleave.js/index.d.ts @@ -6,5 +6,18 @@ import { CleaveOptions } from './options'; -declare function Cleave(selector: string, options: CleaveOptions): void; +declare class Cleave { + constructor(selector: string, options: CleaveOptions); + + getRawValue(): string; + + setRawValue(value: string): void; + + getFormattedValue(): string; + + destroy(): void; + + setPhoneRegionCode(regionCode: string): void; +} + export = Cleave;