index.d.ts 685 B

123456789101112131415161718192021222324252627282930
  1. export interface Options {
  2. /**
  3. * String to use as replacement for reserved filename characters.
  4. *
  5. * Cannot contain: `<` `>` `:` `"` `/` `\` `|` `?` `*`
  6. *
  7. * @default '!'
  8. */
  9. readonly replacement?: string;
  10. }
  11. /**
  12. * Accepts a filename and returns a valid filename.
  13. *
  14. * @param input - A string to convert to a valid filename.
  15. */
  16. export interface Filenamify {
  17. (input: string, options?: Options): string;
  18. /**
  19. * Accepts a path and returns the path with a valid filename.
  20. *
  21. * @param input - A string to convert to a valid path with a filename.
  22. */
  23. path(input: string, options?: Options): string;
  24. }
  25. declare const filenamify: Filenamify;
  26. export default filenamify;