@contentauth/c2pa-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.
Files changed (3) hide show
  1. package/README.md +18 -0
  2. package/index.d.ts +1 -1
  3. package/package.json +1 -1
package/README.md ADDED
@@ -0,0 +1,18 @@
1
+ # c2pa-types
2
+
3
+ Exports TypeScript types autogenerated from [c2pa-rs](https://github.com/contentauth/c2pa-rs) structs, used by c2pa-web.
4
+
5
+ ### Building
6
+
7
+ Ensure the repo-wide prerequisites [NX](https://nx.dev/getting-started/intro) and [pnpm](https://pnpm.io/) are installed.
8
+
9
+ To build the types:
10
+ ```sh
11
+ nx build c2pa-types
12
+ ```
13
+
14
+ The types are built as follows:
15
+ 1. Specific structs ([example](https://github.com/contentauth/c2pa-rs/blob/main/sdk/src/manifest.rs#L55)) from c2pa-rs are annotated with the `schemars::JsonSchema` attribute.
16
+ 2. JSON schema files are generated by calling `schemars::schema_for` and saved to the `schemas/` directory
17
+ 3. Schema files are read by `json-schema-to-typescript` and used to generate TypeScript types, saved to the `types/` directory
18
+ 4. Types are "gathered" and exported from the `index.d.ts` file
package/index.d.ts CHANGED
@@ -13,4 +13,4 @@ import type { Reader } from './types/ManifestStore.js';
13
13
  // eslint-disable-next-line @typescript-eslint/no-empty-interface, @typescript-eslint/no-empty-object-type
14
14
  export interface ManifestStore extends Reader {}
15
15
 
16
- export type { Manifest } from './types/ManifestStore.js';
16
+ export type * from './types/ManifestStore.js';
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@contentauth/c2pa-types",
3
3
  "description": "Typescript types generated from c2pa-rs",
4
4
  "type": "module",
5
- "version": "0.2.0",
5
+ "version": "0.2.1",
6
6
  "types": "index.d.ts",
7
7
  "files": [
8
8
  "index.d.ts",