@tolki/types 1.0.0 → 1.0.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/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "@tolki/types",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Utility TypeScript types for @tolki packages and Laravel HTTP responses.",
5
5
  "author": "Abraham Arango <https://github.com/abetwothree>",
6
6
  "license": "MIT",
7
+ "homepage": "https://tolki.abe.dev/typescript/",
7
8
  "repository": {
8
9
  "type": "git",
9
10
  "url": "git+https://github.com/abetwothree/tolki.git",
package/src/index.d.ts CHANGED
@@ -5,6 +5,6 @@ export type * from "./models";
5
5
  export type * from "./objects";
6
6
  export type * from "./pagination";
7
7
  export type * from "./path-type";
8
- export type * from "./responses";
8
+ export type * from "./resource-responses";
9
9
  export type * from "./strings";
10
10
  export type * from "./utils";
package/src/models.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- export interface Model {
2
- id?: string | number;
1
+ export interface Model<TId = string | number> {
2
+ id?: TId;
3
3
  [key: string]: unknown;
4
4
  }
5
5
 
@@ -12,9 +12,12 @@ export interface SoftDeletes {
12
12
  deleted_at?: string | null;
13
13
  }
14
14
 
15
- export interface TimestampModel extends Model, Timestamps {}
16
- export interface SoftDeleteModel extends Model, SoftDeletes {}
17
- export interface AllTimestampsModel extends Model, Timestamps, SoftDeletes {}
15
+ export interface TimestampModel<TId = string | number>
16
+ extends Model<TId>, Timestamps {}
17
+ export interface SoftDeleteModel<TId = string | number>
18
+ extends Model<TId>, SoftDeletes {}
19
+ export interface AllTimestampsModel<TId = string | number>
20
+ extends Model<TId>, Timestamps, SoftDeletes {}
18
21
 
19
22
  export type AsCount<T extends string> = `${T}_count`;
20
23
  export type AsMax<T extends string> = `${T}_max`;
@@ -18,7 +18,7 @@ export interface JsonResourceLinks {
18
18
  next: string | null;
19
19
  }
20
20
 
21
- export interface JsonResource<T> {
21
+ export interface JsonResourcePaginator<T> {
22
22
  data: T[];
23
23
  meta: JsonResourceMeta;
24
24
  links: JsonResourceLinks;