-
Notifications
You must be signed in to change notification settings - Fork 2
/
std.d.ts
105 lines (95 loc) · 2.72 KB
/
std.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
declare module "std" {
import { File } from "os";
export interface EvalOptions {
backtrace_barrier?: boolean;
}
export interface ErrorOptions {
errorno: Error;
}
export interface URLGetOptions {
binary?: boolean;
full?: boolean;
}
export interface URLGetResponse {
readonly response: string | null;
readonly responseHeaders: string;
readonly status: number;
}
export const SEEK_SET: number; // 0
export const SEEK_CUR: number; // 1
export const SEEK_END: number; // 2
export const S_IFMT: number;
export const S_IFIFO: number;
export const S_IFCHR: number;
export const S_IFDIR: number;
export const S_IFBLK: number;
export const S_IFREG: number;
export const S_IFSOCK: number;
export const S_IFLNK: number;
export const S_ISGID: number;
export const S_ISUID: number;
export type Seek = unknown;
export const enum Error {
EACCES = 13,
EBUSY = 16,
EEXIST = 17,
EINVAL = 22,
EIO = 5,
ENOENT = 2,
ENOSPC = 28,
ENOSYS = 38,
EPERM = 1,
EPIPE = 32,
}
export function exit(n: number): void;
export function evalScript(script: string, options?: EvalOptions): void;
export function loadScript(filename: string): void;
export function loadFile(filename: string): void;
export function open(
filename: string,
flags: unknown,
errorObj?: ErrorOptions
): File | null;
export function popen(
command: string,
flags: unknown,
errorObj?: ErrorOptions
): File | null;
export function fdopen(
file: File,
flags: unknown,
errorObj?: ErrorOptions
): File | null;
export function tmpFile(errorObj?: ErrorOptions): File | null;
export function puts(str: string): void;
export function printf(fmt: string, ...args: any[]): void;
export function sprintf(fmt: string, ...args: any[]): void;
export function strerror(errorno: Error): string;
export function gc(): void;
export function getenv(name: string): any | undefined;
export function setenv(name: string, value: any): void;
export function unsetenv(name: string): void;
export function getenviron(): { readonly [key: string]: string };
export function urlGet(url: string): string;
export function urlGet(
url: string,
options: { full?: false; binary: false }
): string;
export function urlGet(
url: string,
options: { full?: false; binary: true }
): ArrayBuffer;
export function urlGet(
url: string,
options: { full: true; binary?: false }
): URLGetResponse;
export function urlGet(
url: string,
options: { full: true; binary?: false }
): ArrayBuffer;
export function parseExtJSON(str: string): any;
const _in: File;
export { _in as in };
export const err: File;
export const out: File;
}