options.d.ts 722 B

1234567891011121314151617181920
  1. import { DateToken } from './tokens.js';
  2. /**
  3. * Parent class for errors.
  4. *
  5. * @remarks
  6. * Errors with `type: "warning"` do not necessarily indicate that the parser
  7. * encountered an error. In addition to a human-friendly `message`, may also
  8. * includes the `token` at which the error was encountered.
  9. *
  10. * @public
  11. */
  12. export declare class DateFormatError extends Error {
  13. static ERROR: 'error';
  14. static WARNING: 'warning';
  15. token: DateToken;
  16. type: 'error' | 'warning';
  17. /** @internal */
  18. constructor(msg: string, token: DateToken, type?: 'error' | 'warning');
  19. }
  20. export declare function getDateFormatOptions(tokens: DateToken[], onError?: (error: DateFormatError) => void): Intl.DateTimeFormatOptions;