JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q25602F
  • License MIT

Protobuf full runtime for sisyphus project on js platform, support protobuf binary format.

Package Exports

  • @sisyphus.js/runtime.proto
  • @sisyphus.js/runtime.proto/lib/google/protobuf/any.proto
  • @sisyphus.js/runtime.proto/lib/google/protobuf/any.proto.js
  • @sisyphus.js/runtime.proto/lib/google/protobuf/api.proto
  • @sisyphus.js/runtime.proto/lib/google/protobuf/api.proto.js
  • @sisyphus.js/runtime.proto/lib/google/protobuf/duration.proto
  • @sisyphus.js/runtime.proto/lib/google/protobuf/duration.proto.js
  • @sisyphus.js/runtime.proto/lib/google/protobuf/struct.proto
  • @sisyphus.js/runtime.proto/lib/google/protobuf/struct.proto.js
  • @sisyphus.js/runtime.proto/lib/google/protobuf/timestamp.proto
  • @sisyphus.js/runtime.proto/lib/google/protobuf/timestamp.proto.js
  • @sisyphus.js/runtime.proto/lib/google/protobuf/type.proto
  • @sisyphus.js/runtime.proto/lib/google/protobuf/type.proto.js
  • @sisyphus.js/runtime.proto/lib/google/protobuf/wrappers.proto
  • @sisyphus.js/runtime.proto/lib/google/protobuf/wrappers.proto.js
  • @sisyphus.js/runtime.proto/lib/index.js
  • @sisyphus.js/runtime.proto/lib/message
  • @sisyphus.js/runtime.proto/lib/message.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@sisyphus.js/runtime.proto) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@sisyphus.js/runtime.proto

sisyphus.js Protobuf 运行时,用于仅支持 Protobuf 二进制格式,包含预编译的 well-known protos 的序列化/反序列化支持。

拓展同名 namespace

sisyphus.js 子插件都通过拓展消息实体同名的 namespace 提供更多的功能。

sisyphus.js 的 proto 编辑插件会为同名 namespace 添加一个 descriptor 字段与两个用于反序列与序列化的方法。

// 拓展 core 编译的核心模块定义
declare module './any' {
    namespace Any {
        // 添加 descriptor 用于运行时反射与保存序列化信息
        let descriptor: MessageDescriptor<Any>

        // 添加 binaryify 方法用于序列化消息实体
        function binaryify(v: Any): Uint8Array

        // 添加 parse 方法用于反序列化消息实体
        function parse(buffer: Uint8Array): Any
    }
}

// 将 core 编译的核心模块重新导出,可以在自模块中访问完整的核心模块定义。
export * from './any'