{"id":16872364,"url":"https://github.com/robjtede/json-types","last_synced_at":"2025-07-24T13:34:34.087Z","repository":{"id":57285449,"uuid":"101586940","full_name":"robjtede/json-types","owner":"robjtede","description":"[Deprecated] JSON TypeScript Definitions","archived":false,"fork":false,"pushed_at":"2020-03-22T22:38:29.000Z","size":13,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-11T00:12:46.246Z","etag":null,"topics":["json","types","typescript","typings"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/json-types","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/robjtede.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-08-27T23:38:03.000Z","updated_at":"2020-03-22T22:38:31.000Z","dependencies_parsed_at":"2022-09-16T22:22:22.738Z","dependency_job_id":null,"html_url":"https://github.com/robjtede/json-types","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robjtede%2Fjson-types","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robjtede%2Fjson-types/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robjtede%2Fjson-types/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robjtede%2Fjson-types/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robjtede","download_url":"https://codeload.github.com/robjtede/json-types/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248410923,"owners_count":21098799,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["json","types","typescript","typings"],"created_at":"2024-10-13T15:14:32.290Z","updated_at":"2025-04-11T13:44:44.819Z","avatar_url":"https://github.com/robjtede.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Deprecation Notice\n\nAs of TypeScript 3.7, it's no longer necessary to use the workaround in this\npackage for defining valid JSON structures.\n\nThis small snippet is all that is required now:\n\n```typescript\ntype Json =\n  | string\n  | number\n  | boolean\n  | null\n  | Record\u003cstring, Json\u003e\n  | Json[];\n```\n\n---\n\n# json-types\n\n\u003e JSON TypeScript Definitions\n\u003e\n\u003e A simple typescript definition module that simplifies type checking for valid JSON objects. Useful for defining interfaces and parameter type checking.\n\n## Installation\n\n```shell\nnpm i json-types\n```\n\n## Usage\n\n```typescript\nimport {\n  Primitive,\n  JSONEntry,\n  JSONArray,\n  JSONMap,\n  JSONData\n} from '../json-types'\n```\n\n### Use Case\n\n```typescript\nimport {\n  Primitive,\n  JSONEntry,\n  JSONArray,\n  JSONMap,\n  JSONData\n} from '../json-types'\n\ninterface QueryString {\n  [key: string]: Primitive | undefined\n}\n\ninterface APIResponse extends JSONMap {\n  address: {\n    house_no: number\n    street: string\n  }\n  name: string,\n  has_website: false\n  files: JSONArray\n  metadata: JSONEntry\n}\n\nfunction httpGet (url: string): Promise\u003cJSONData\u003e {\n  return requestPromise(url, {\n    json: true\n  })\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobjtede%2Fjson-types","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobjtede%2Fjson-types","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobjtede%2Fjson-types/lists"}