Skip to content

Commit

Permalink
fix(core): type page cursors as strings
Browse files Browse the repository at this point in the history
  • Loading branch information
aerovulpe committed Sep 27, 2023
1 parent 9edf77c commit bccb95d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/core/src/lib/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ export type CountUnreadChannelsRequest = ListUnreadChannelsRequest;

export declare class RetrieveChannelContextRequest {
channel: Channel;
startCursor: number;
endCursor: number;
startCursor: string;
endCursor: string;
}

export declare class RetrieveChannelUnreadRequest {
Expand Down
1 change: 0 additions & 1 deletion packages/core/src/lib/message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ export type FileMessage = FileSystemMessage | FileUserMessage;

export interface BaseMessage {
id: number;
cursor: number;
type: string;
channelId: number;
createdTime: string;
Expand Down
5 changes: 4 additions & 1 deletion packages/core/src/lib/pagination.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import StompX, { StompXError, StompXPage } from './stompx';
import StompX, { StompXError, StompXPage, StompXPageMetadata } from './stompx';

import { ChatKittyError } from './error';

Expand Down Expand Up @@ -40,6 +40,7 @@ export class ChatKittyPaginator<I> {

return new ChatKittyPaginator<I>(
items,
page.page,
request.stompX,
request.contentName,
page._relays.prev,
Expand All @@ -52,6 +53,7 @@ export class ChatKittyPaginator<I> {

private constructor(
public items: I[],
public page: StompXPageMetadata,
private stompX: StompX,
private contentName: string,
private prevRelay?: string,
Expand Down Expand Up @@ -115,6 +117,7 @@ export class ChatKittyPaginator<I> {

return new ChatKittyPaginator<I>(
items,
page.page,
this.stompX,
this.contentName,
page._relays.prev,
Expand Down

0 comments on commit bccb95d

Please sign in to comment.