Skip to content

Commit

Permalink
chore: improved types
Browse files Browse the repository at this point in the history
  • Loading branch information
LinusBolls committed Nov 6, 2024
1 parent ddfdc01 commit e1fcb40
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 21 deletions.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export { default as SplidClient } from './SplidClient';

export { SplidJs } from './types';
export type { SplidJs } from './types';
11 changes: 7 additions & 4 deletions src/methods/createGroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@ import { UpdateGroupResponse } from './updateGroup';

export interface CreateGroupRawResponse {
result: {
code: 'UVFP588H7';
longCode: 'R6sjlghj8lPm14IGjMkJdEFjPUPYKemcWpwbkrRtDezSQprVAdwGDkEnnKuQoeo8';
extendedShortCode: 'UVFP588H7L';
objectId: 'oCCCOtA24J';
/**
* the invite code used to join the group
*/
code: string;
longCode: string;
extendedShortCode: string;
objectId: string;
};
}

Expand Down
11 changes: 5 additions & 6 deletions src/methods/joinGroupWithAnyCode.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { AxiosError } from 'axios';
import { RequestConfig } from '../requestConfig';

export type JoinGroupWithCode400Response =
Expand All @@ -7,13 +6,13 @@ export type JoinGroupWithCode400Response =

export type JoinGroupWithAnyCodeResponse = {
result: {
objectId: 'LLTvQ7oHPI';
objectId: string;
/**
* the invite code for this group is "PWJE2BP7K"
* the invite code used to join the group
*/
shortCode: 'PWJE2B';
extendedShortCode: 'PWJE2BP7K9';
longCode: 'jaW3PQ9KAqgfe1DZmx9ysCJhrZx5ZTxmdfpx4W5jZBiTcSy7C1hIbaL7Iyk3lQne';
shortCode: string;
extendedShortCode: string;
longCode: string;
};
};

Expand Down
4 changes: 2 additions & 2 deletions src/types/entry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,15 @@ export interface Entry {
group: {
__type: 'Pointer';
className: '_User';
objectId: 'QfQhx0XSSc';
objectId: string;
};
items: EntryItem[];
isPayment: boolean;
UpdateID: Uuid;
currencyCode: CurrencyCode;
createdAt: IsoTime;
updatedAt: IsoTime;
objectId: 'KITH5S6HmD';
objectId: string;
__type: 'Object';
className: 'Entry';

Expand Down
11 changes: 7 additions & 4 deletions src/types/groupInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { CurrencyCode, GroupId, IsoTime, Uuid } from './primitives';

export interface GroupInfo {
UpdateInstallationID: Uuid;
name: string; // e.g. "La Famiglia"
name: string;
defaultCurrencyCode: CurrencyCode;
creatorInstallationID: Uuid;
UpdateID: Uuid;
Expand All @@ -18,13 +18,16 @@ export interface GroupInfo {
group: {
__type: 'Pointer';
className: '_User';
objectId: 'QfQhx0XSSc';
objectId: string;
};
createdAt: IsoTime;
updatedAt: IsoTime;
customCategories: string[]; // e.g. [ "Food" ]
/**
* e.g. [ "Food" ]
*/
customCategories: string[];
isDeleted: boolean;
objectId: 'AL5VHgcVHE';
objectId: string;
__type: 'Object';
className: 'GroupInfo';

Expand Down
8 changes: 4 additions & 4 deletions src/types/person.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ export interface Person {
group: {
__type: 'Pointer';
className: '_User';
objectId: 'QfQhx0XSSc';
objectId: string;
};
name: string; // e.g. "Daniel" (yes, even when `isDeleted: true`)
initials: string; // e.g. "D"
name: string;
initials: string;
createdAt: IsoTime;
updatedAt: IsoTime;
objectId: 'Pv2p7KumiG';
objectId: string;
__type: 'Object';
className: 'Person';
}

0 comments on commit e1fcb40

Please sign in to comment.