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

Support type variable for documents in TypeScript #298

Closed
hackerwins opened this issue May 25, 2022 · 1 comment
Closed

Support type variable for documents in TypeScript #298

hackerwins opened this issue May 25, 2022 · 1 comment
Labels
enhancement 🌟 New feature or request

Comments

@hackerwins
Copy link
Member

hackerwins commented May 25, 2022

Description:

Change the SDK interface so that TypeScript users can use the type system better.

type Model = {
  k1: Array<number>;
  k2: yorkie.Array<string>;
  k3: {key: string};
  k4: yorkie.Object<{key: string}>;
  k5: yorkie.Text;
  k6: yorkie.RichText;
}

const doc = new yorkie.Document<Model>('doc-key');
doc.update((root) => {
  root.k1 = [1,2,3];
  root.k2 = new yorkie.Array<string>();
  root.k3 = {key: 'abcd'};
  root.k4 = new yorkie.Object<{key: string}>({key: 'abcd'});
  root.k5 = new yorkie.Text();
  root.k6 = new yorkie.RichText();
});

This issue is a follow-up to #289..

Why:

  • TypeScript users can use the type system better
@hackerwins hackerwins added the enhancement 🌟 New feature or request label May 25, 2022
@hackerwins hackerwins transferred this issue from yorkie-team/yorkie May 25, 2022
This was referenced May 25, 2022
@blurfx blurfx added good first issue 🐤 Good for newcomers and removed good first issue 🐤 Good for newcomers labels Jul 10, 2022
@hackerwins
Copy link
Member Author

This was resolved by #299, #300.

@hackerwins hackerwins changed the title Change the SDK interface Support type variable for documents in TypeScript Aug 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement 🌟 New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants