DefinitelyTyped/types/react-aria-live/index.d.ts
AJ Livingston bd8c74539c adds typings for react-aria-live (#37996)
* adds typings for react-aria-live

* added typescript version

* formatting

* fixed lint error

* updated return type of LiveMessenger children

* formatting
2019-09-04 15:53:43 -07:00

26 lines
874 B
TypeScript

// Type definitions for react-aria-live 2.0
// Project: https://github.com/AlmeroSteyn/react-aria-live#readme
// Definitions by: AJ Livingston <https://github.com/ajliv>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
import * as React from 'react';
export class LiveAnnouncer extends React.Component {
announcePolite(message: string, id?: string): void;
announceAssertive(message: string, id?: string): void;
}
export const LiveMessage: React.StatelessComponent<{
'aria-live': 'assertive' | 'polite';
clearOnUnmount?: boolean | 'true' | 'false';
message: string;
}>;
export const LiveMessenger: React.StatelessComponent<{
children(contextProps: {
announceAssertive(message: string, id?: string): void;
announcePolite(message: string, id?: string): void;
}): React.ReactNode;
}>;