Skip to content

Instantly share code, notes, and snippets.

@mrclay
Created October 6, 2022 16:18
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrclay/b418e2ad2842dac6e76567921d211df3 to your computer and use it in GitHub Desktop.
Save mrclay/b418e2ad2842dac6e76567921d211df3 to your computer and use it in GitHub Desktop.
Example d.ts file for a JSON file
// filename.json <-- the data
// filename.json.d.ts <-- type definition (this file)
// Just an example type
const value: Record<string, string>;
export default value;
@mrclay
Copy link
Author

mrclay commented May 1, 2023

This will also work for any data file webpack can import but typescript doesn't recognize (yet), like yaml or "json5".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment