Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
f46e1061
V
vscode
项目概览
xxadev
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f46e1061
编写于
1月 20, 2017
作者:
J
Johannes Rieken
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
have proper NodeBuffer definition in place
上级
e99d2951
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
63 addition
and
1 deletion
+63
-1
src/typings/node.d.ts
src/typings/node.d.ts
+63
-1
未找到文件。
src/typings/node.d.ts
浏览文件 @
f46e1061
...
...
@@ -109,6 +109,14 @@ declare var Buffer: {
* @param array The octets to store.
*/
new
(
array
:
Uint8Array
):
Buffer
;
/**
* Produces a Buffer backed by the same allocated memory as
* the given {ArrayBuffer}.
*
*
* @param arrayBuffer The ArrayBuffer with which to share memory.
*/
new
(
arrayBuffer
:
ArrayBuffer
):
Buffer
;
/**
* Allocates a new buffer containing the given {array} of octets.
*
...
...
@@ -122,6 +130,37 @@ declare var Buffer: {
*/
new
(
buffer
:
Buffer
):
Buffer
;
prototype
:
Buffer
;
/**
* Allocates a new Buffer using an {array} of octets.
*
* @param array
*/
from
(
array
:
any
[]):
Buffer
;
/**
* When passed a reference to the .buffer property of a TypedArray instance,
* the newly created Buffer will share the same allocated memory as the TypedArray.
* The optional {byteOffset} and {length} arguments specify a memory range
* within the {arrayBuffer} that will be shared by the Buffer.
*
* @param arrayBuffer The .buffer property of a TypedArray or a new ArrayBuffer()
* @param byteOffset
* @param length
*/
from
(
arrayBuffer
:
ArrayBuffer
,
byteOffset
?:
number
,
length
?:
number
):
Buffer
;
/**
* Copies the passed {buffer} data onto a new Buffer instance.
*
* @param buffer
*/
from
(
buffer
:
Buffer
):
Buffer
;
/**
* Creates a new Buffer containing the given JavaScript string {str}.
* If provided, the {encoding} parameter identifies the character encoding.
* If not provided, {encoding} defaults to 'utf8'.
*
* @param str
*/
from
(
str
:
string
,
encoding
?:
string
):
Buffer
;
/**
* Returns true if {obj} is a Buffer
*
...
...
@@ -159,6 +198,29 @@ declare var Buffer: {
* The same as buf1.compare(buf2).
*/
compare
(
buf1
:
Buffer
,
buf2
:
Buffer
):
number
;
/**
* Allocates a new buffer of {size} octets.
*
* @param size count of octets to allocate.
* @param fill if specified, buffer will be initialized by calling buf.fill(fill).
* If parameter is omitted, buffer will be filled with zeros.
* @param encoding encoding used for call to buf.fill while initalizing
*/
alloc
(
size
:
number
,
fill
?:
string
|
Buffer
|
number
,
encoding
?:
string
):
Buffer
;
/**
* Allocates a new buffer of {size} octets, leaving memory not initialized, so the contents
* of the newly created Buffer are unknown and may contain sensitive data.
*
* @param size count of octets to allocate
*/
allocUnsafe
(
size
:
number
):
Buffer
;
/**
* Allocates a new non-pooled buffer of {size} octets, leaving memory not initialized, so the contents
* of the newly created Buffer are unknown and may contain sensitive data.
*
* @param size count of octets to allocate
*/
allocUnsafeSlow
(
size
:
number
):
Buffer
;
};
/************************************************
...
...
@@ -2311,4 +2373,4 @@ declare module "constants" {
export
var
W_OK
:
number
;
export
var
X_OK
:
number
;
export
var
UV_UDP_REUSEADDR
:
number
;
}
\ No newline at end of file
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录