@univerjs/protocol 0.1.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.
Files changed (40) hide show
  1. package/README.md +3 -0
  2. package/lib/cjs/index.js +1 -0
  3. package/lib/es/index.js +13 -0
  4. package/lib/types/index.d.ts +13 -0
  5. package/lib/types/ts/google/api/annotations.d.ts +1 -0
  6. package/lib/types/ts/google/api/http.d.ts +352 -0
  7. package/lib/types/ts/google/protobuf/descriptor.d.ts +825 -0
  8. package/lib/types/ts/google/protobuf/duration.d.ts +78 -0
  9. package/lib/types/ts/google/protobuf/empty.d.ts +14 -0
  10. package/lib/types/ts/google/protobuf/struct.d.ts +65 -0
  11. package/lib/types/ts/google/protobuf/timestamp.d.ts +107 -0
  12. package/lib/types/ts/tagger/tagger.d.ts +1 -0
  13. package/lib/types/ts/univer/changeset.d.ts +19 -0
  14. package/lib/types/ts/univer/colla_msg.d.ts +76 -0
  15. package/lib/types/ts/univer/constants/errors.d.ts +32 -0
  16. package/lib/types/ts/univer/constants/univer.d.ts +8 -0
  17. package/lib/types/ts/univer/doc.d.ts +12 -0
  18. package/lib/types/ts/univer/drawing.d.ts +7 -0
  19. package/lib/types/ts/univer/resource.d.ts +6 -0
  20. package/lib/types/ts/univer/snapshot.d.ts +12 -0
  21. package/lib/types/ts/univer/unit_template.d.ts +9 -0
  22. package/lib/types/ts/univer/univer_file.d.ts +33 -0
  23. package/lib/types/ts/univer/workbook.d.ts +112 -0
  24. package/lib/types/ts/v1/apply.d.ts +72 -0
  25. package/lib/types/ts/v1/comb.d.ts +109 -0
  26. package/lib/types/ts/v1/conf.d.ts +88 -0
  27. package/lib/types/ts/v1/connector.d.ts +74 -0
  28. package/lib/types/ts/v1/exchange.d.ts +83 -0
  29. package/lib/types/ts/v1/file.d.ts +14 -0
  30. package/lib/types/ts/v1/snapshot.d.ts +130 -0
  31. package/lib/types/ts/v1/source_connector/api.d.ts +110 -0
  32. package/lib/types/ts/v1/source_connector/conf.d.ts +29 -0
  33. package/lib/types/ts/v1/source_connector/displayer.d.ts +16 -0
  34. package/lib/types/ts/v1/source_connector/source.d.ts +46 -0
  35. package/lib/types/ts/v1/source_connector/stream_view.d.ts +31 -0
  36. package/lib/types/ts/v1/transform.d.ts +38 -0
  37. package/lib/types/ts/validate/validate.d.ts +950 -0
  38. package/lib/types/utils.d.ts +8 -0
  39. package/lib/umd/index.js +1 -0
  40. package/package.json +47 -0
@@ -0,0 +1,8 @@
1
+ import type { Error } from './ts/univer/constants/errors';
2
+ /**
3
+ * To examine if a response is an error.
4
+ *
5
+ * @param error error interface
6
+ * @returns if the response is an error
7
+ */
8
+ export declare function isError(error?: Error): boolean;
@@ -0,0 +1 @@
1
+ (function(E,I){typeof exports=="object"&&typeof module<"u"?I(exports):typeof define=="function"&&define.amd?define(["exports"],I):(E=typeof globalThis<"u"?globalThis:E||self,I(E.UniverProtocol={}))})(this,function(E){"use strict";var I=(N=>(N[N.UNDEFINED=0]="UNDEFINED",N[N.OK=1]="OK",N[N.INTERNAL_ERROR=2]="INTERNAL_ERROR",N[N.PERMISSION_DENIED=3]="PERMISSION_DENIED",N[N.NOT_FOUND=4]="NOT_FOUND",N[N.UNAUTHENTICATED=5]="UNAUTHENTICATED",N[N.ALREADY_EXISTS=6]="ALREADY_EXISTS",N[N.INVALID_ARGUMENT=7]="INVALID_ARGUMENT",N[N.CHANGESET_REVISION_CONFILICT=5001]="CHANGESET_REVISION_CONFILICT",N[N.SNAPSHOT_INVALID_SNAPSHOT=6001]="SNAPSHOT_INVALID_SNAPSHOT",N[N.APPLY_REJECT=7001]="APPLY_REJECT",N[N.APPLY_NON_SEQUENTIAL_REVISION=7002]="APPLY_NON_SEQUENTIAL_REVISION",N[N.APPLY_REVISION_CONFILICT=7003]="APPLY_REVISION_CONFILICT",N[N.CONNECTOR_DATA_TOO_LARGE=8001]="CONNECTOR_DATA_TOO_LARGE",N[N.LICENSE_MAX_UNITS_EXCEEDED=9001]="LICENSE_MAX_UNITS_EXCEEDED",N[N.LICENSE_MAX_MEMBERS_PER_UNIT_EXCEEDED=9002]="LICENSE_MAX_MEMBERS_PER_UNIT_EXCEEDED",N[N.UNRECOGNIZED=-1]="UNRECOGNIZED",N))(I||{});function D(N){return!!(N&&N.code&&N.code!==I.OK&&N.code!=="OK")}var O=(N=>(N[N.UNIVER_UNKNOWN=0]="UNIVER_UNKNOWN",N[N.UNIVER_DOC=1]="UNIVER_DOC",N[N.UNIVER_SHEET=2]="UNIVER_SHEET",N[N.UNIVER_SLIDE=3]="UNIVER_SLIDE",N[N.UNRECOGNIZED=-1]="UNRECOGNIZED",N))(O||{}),_=(N=>(N[N.UNKNOWN=0]="UNKNOWN",N[N.STRING=1]="STRING",N[N.NUMBER=2]="NUMBER",N[N.BOOLEAN=3]="BOOLEAN",N[N.FORCE_STRING=4]="FORCE_STRING",N[N.UNRECOGNIZED=-1]="UNRECOGNIZED",N))(_||{}),R=(N=>(N[N.UNKNOWN_CMD=0]="UNKNOWN_CMD",N[N.HELLO=1]="HELLO",N[N.JOIN=2]="JOIN",N[N.LEAVE=3]="LEAVE",N[N.INGEST=4]="INGEST",N[N.HEARTBEAT=5]="HEARTBEAT",N[N.RECV=6]="RECV",N[N.UNRECOGNIZED=-1]="UNRECOGNIZED",N))(R||{}),A=(N=>(N[N.UNKNOWN_CODE=0]="UNKNOWN_CODE",N[N.OK=1]="OK",N[N.FAIL=2]="FAIL",N[N.UNRECOGNIZED=-1]="UNRECOGNIZED",N))(A||{});E.CellValueType=_,E.CmdRspCode=A,E.CombCmd=R,E.ErrorCode=I,E.UniverType=O,E.isError=D,Object.defineProperty(E,Symbol.toStringTag,{value:"Module"})});
package/package.json ADDED
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "@univerjs/protocol",
3
+ "version": "0.1.0",
4
+ "private": false,
5
+ "description": "A protocol of Univer repos",
6
+ "author": "DreamNum <developer@univer.ai>",
7
+ "exports": {
8
+ ".": {
9
+ "import": "./lib/es/index.js",
10
+ "require": "./lib/cjs/index.js",
11
+ "types": "./lib/types/index.d.ts"
12
+ },
13
+ "./*": {
14
+ "import": "./lib/es/*",
15
+ "require": "./lib/cjs/*",
16
+ "types": "./lib/types/index.d.ts"
17
+ },
18
+ "./lib/*": "./lib/*"
19
+ },
20
+ "main": "./lib/cjs/index.js",
21
+ "module": "./lib/es/index.js",
22
+ "types": "./lib/types/index.d.ts",
23
+ "publishConfig": {
24
+ "access": "public"
25
+ },
26
+ "directories": {
27
+ "lib": "lib"
28
+ },
29
+ "files": [
30
+ "lib"
31
+ ],
32
+ "engines": {
33
+ "node": ">=16.0.0",
34
+ "npm": ">=8.0.0"
35
+ },
36
+ "peerDependencies": {
37
+ "@grpc/grpc-js": "^1.9.14",
38
+ "rxjs": ">=7.0.0"
39
+ },
40
+ "devDependencies": {
41
+ "vite": "^5.1.4",
42
+ "vite-plugin-dts": "^3.7.3"
43
+ },
44
+ "scripts": {
45
+ "build": "tsc && vite build"
46
+ }
47
+ }