@jsonresume/types 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +85 -0
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# @jsonresume/types
|
|
2
|
+
|
|
3
|
+
TypeScript types for the [JSON Resume](https://jsonresume.org) and Job schemas, generated from `@jsonresume/schema`.
|
|
4
|
+
|
|
5
|
+
This is a **types-only** package: the runtime entry point is intentionally empty and the interfaces are emitted (as `.d.ts`) from the canonical schema, so they never drift from the spec.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install --save-dev @jsonresume/types
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## API
|
|
14
|
+
|
|
15
|
+
A single root export (`.`) ships the following interfaces and type aliases.
|
|
16
|
+
|
|
17
|
+
### Resume
|
|
18
|
+
|
|
19
|
+
| Type | Description |
|
|
20
|
+
| --- | --- |
|
|
21
|
+
| `Resume` | The full JSON Resume document. All sections are optional; unknown keys are allowed. |
|
|
22
|
+
| `ResumeBasics` | `basics` — name, label, email, phone, url, summary, location, profiles. |
|
|
23
|
+
| `ResumeLocation` | The `basics.location` object (address, city, region, countryCode, postalCode). |
|
|
24
|
+
| `ResumeProfile` | An entry in `basics.profiles` (network, username, url). |
|
|
25
|
+
| `WorkItem` | An entry in `work`. |
|
|
26
|
+
| `VolunteerItem` | An entry in `volunteer`. |
|
|
27
|
+
| `EducationItem` | An entry in `education`. |
|
|
28
|
+
| `AwardItem` | An entry in `awards`. |
|
|
29
|
+
| `CertificateItem` | An entry in `certificates`. |
|
|
30
|
+
| `PublicationItem` | An entry in `publications`. |
|
|
31
|
+
| `SkillItem` | An entry in `skills`. |
|
|
32
|
+
| `LanguageItem` | An entry in `languages`. |
|
|
33
|
+
| `InterestItem` | An entry in `interests`. |
|
|
34
|
+
| `ReferenceItem` | An entry in `references`. |
|
|
35
|
+
| `ProjectItem` | An entry in `projects`. |
|
|
36
|
+
| `ResumeMeta` | The `meta` object (canonical, version, lastModified). |
|
|
37
|
+
| `Iso8601` | String alias for partial ISO-8601 dates, e.g. `2014-06-29` or `2023-04`. |
|
|
38
|
+
|
|
39
|
+
### Job
|
|
40
|
+
|
|
41
|
+
| Type | Description |
|
|
42
|
+
| --- | --- |
|
|
43
|
+
| `JobDescription` | A job posting in the JSON Resume Job schema (title, company, type, location, remote, salary, responsibilities, qualifications, skills, meta). |
|
|
44
|
+
|
|
45
|
+
## Usage
|
|
46
|
+
|
|
47
|
+
Type a resume object you load from disk or an API:
|
|
48
|
+
|
|
49
|
+
```ts
|
|
50
|
+
import type { Resume } from '@jsonresume/types';
|
|
51
|
+
|
|
52
|
+
const resume: Resume = JSON.parse(await readFile('resume.json', 'utf8'));
|
|
53
|
+
|
|
54
|
+
console.log(resume.basics?.name);
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Annotate a function that operates on a single section:
|
|
58
|
+
|
|
59
|
+
```ts
|
|
60
|
+
import type { WorkItem } from '@jsonresume/types';
|
|
61
|
+
|
|
62
|
+
function formatRole(job: WorkItem): string {
|
|
63
|
+
return `${job.position ?? 'Unknown'} @ ${job.name ?? 'Unknown'}`;
|
|
64
|
+
}
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Type a job posting with the Job schema:
|
|
68
|
+
|
|
69
|
+
```ts
|
|
70
|
+
import type { JobDescription } from '@jsonresume/types';
|
|
71
|
+
|
|
72
|
+
const job: JobDescription = {
|
|
73
|
+
title: 'Web Developer',
|
|
74
|
+
company: 'Microsoft',
|
|
75
|
+
remote: 'Hybrid',
|
|
76
|
+
};
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Ecosystem
|
|
80
|
+
|
|
81
|
+
Part of the [JSON Resume](https://jsonresume.org) ecosystem. See the roadmap and related packages in [jsonresume/jsonresume.org#421](https://github.com/jsonresume/jsonresume.org/issues/421).
|
|
82
|
+
|
|
83
|
+
## License
|
|
84
|
+
|
|
85
|
+
MIT
|