Renamed protobuf to protobufjs

This commit is contained in:
Panu Horsmalahti
2015-01-03 16:52:36 +02:00
parent a7852e85fd
commit 09f3af655c
2 changed files with 0 additions and 0 deletions
+11
View File
@@ -0,0 +1,11 @@
/// <reference path="protobuf.d.ts" />
import ProtoBuf = require("protobufjs");
ProtoBuf.loadProtoFile("test.proto", builder => {
builder.build();
var message: ProtoBuf.IProtoBufMessage;
message.toArrayBuffer();
message.toBuffer();
});
+23
View File
@@ -0,0 +1,23 @@
// Type definitions for ProtoBuf.js
// Project: https://github.com/dcodeIO/ProtoBuf.js
// Definitions by: Panu Horsmalahti <https://github.com/panuhorsmalahti>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
declare module ProtoBuf {
export interface IBuilder {
build: <T>() => T;
}
export interface IProtoBufMessage {
toArrayBuffer(): ArrayBuffer;
toBuffer(): Buffer;
}
export function loadProtoFile(filePath: string, callback: (builder: IBuilder) => void): any;
}
declare module "protobufjs" {
export = ProtoBuf;
}