@seam-rpc/client 1.1.2 → 2.0.0
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/README.md +16 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -142,3 +142,19 @@ export async function updateUser(userId: string, userData: UserData): Promise<vo
|
|
|
142
142
|
- The generated client files contain all imports from the api implementation file in the backend that import from the current relative folder (`./`). This is the simplest way I have to include imports (at least for now). It may import functions and unused symbols but that shouldn't be too worrying.
|
|
143
143
|
- Don't include backend/server functions inside the server api files.
|
|
144
144
|
- Only exported functions will be included in the client generated files.
|
|
145
|
+
|
|
146
|
+
## Supported types
|
|
147
|
+
SeamRPC supports the following types (at least for now):
|
|
148
|
+
- string
|
|
149
|
+
- number
|
|
150
|
+
- boolean
|
|
151
|
+
- array
|
|
152
|
+
- object
|
|
153
|
+
- null
|
|
154
|
+
- undefined
|
|
155
|
+
|
|
156
|
+
Classes are technically supported, in that the data is serialized to JSON.
|
|
157
|
+
|
|
158
|
+
Other JavaScript types are not supported, although SeamRPC doesn't prevent you from using them, in which case they might lead to unexpected beahviour or even errors.
|
|
159
|
+
|
|
160
|
+
The Date object type is not supported (at least for now). However, you can use `number` and pass `Date.now()` or `string` and pass `new Date().toString()`. This is not different than a normal HTTP request using JSON. SeamRPC also uses JSON behind the scenes, that's why there's these limitations, which could be overcome but I've decided not to because it would probably add more overhead to the logic.
|