Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

export "RecordService" for TypeScript #153

Closed
humanfriend22 opened this issue Feb 21, 2023 · 1 comment
Closed

export "RecordService" for TypeScript #153

humanfriend22 opened this issue Feb 21, 2023 · 1 comment

Comments

@humanfriend22
Copy link

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch [email protected] for the project I'm working on.

I was passing around a collection returned by pb.collection('COLLECTION_NAME') & as I was using TypeScript, I needed to strongly type the argument & I found that the function above returns RecordService so I exported it.

Here is the diff that solved my problem:

diff --git a/node_modules/pocketbase/dist/pocketbase.es.d.mts b/node_modules/pocketbase/dist/pocketbase.es.d.mts
index 5dddb52..5fdcf1b 100644
--- a/node_modules/pocketbase/dist/pocketbase.es.d.mts
+++ b/node_modules/pocketbase/dist/pocketbase.es.d.mts
@@ -483,7 +483,7 @@ interface RecordSubscription<T = Record> {
     action: string;
     record: T;
 }
-declare class RecordService extends CrudService<Record> {
+export declare class RecordService extends CrudService<Record> {
     readonly collectionIdOrName: string;
     constructor(client: Client, collectionIdOrName: string);
     /**

This issue body was partially generated by patch-package.

@ganigeorgiev
Copy link
Member

The types should be exported in v0.11.1 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants