@arborium/php 0.3.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.
@@ -0,0 +1,15 @@
1
+ /** @module Interface arborium:grammar/plugin@0.1.0 **/
2
+ export function languageId(): string;
3
+ export function injectionLanguages(): Array<string>;
4
+ export function createSession(): Session;
5
+ export function freeSession(session: Session): void;
6
+ export function setText(session: Session, text: string): void;
7
+ export function applyEdit(session: Session, text: string, edit: Edit): void;
8
+ export function parse(session: Session): ParseResult;
9
+ export function cancel(session: Session): void;
10
+ export type Span = import('./arborium-grammar-types.js').Span;
11
+ export type Injection = import('./arborium-grammar-types.js').Injection;
12
+ export type ParseResult = import('./arborium-grammar-types.js').ParseResult;
13
+ export type Edit = import('./arborium-grammar-types.js').Edit;
14
+ export type ParseError = import('./arborium-grammar-types.js').ParseError;
15
+ export type Session = number;
@@ -0,0 +1,30 @@
1
+ /** @module Interface arborium:grammar/types@0.1.0 **/
2
+ export interface Span {
3
+ start: number,
4
+ end: number,
5
+ capture: string,
6
+ }
7
+ export interface Injection {
8
+ start: number,
9
+ end: number,
10
+ language: string,
11
+ includeChildren: boolean,
12
+ }
13
+ export interface ParseResult {
14
+ spans: Array<Span>,
15
+ injections: Array<Injection>,
16
+ }
17
+ export interface Edit {
18
+ startByte: number,
19
+ oldEndByte: number,
20
+ newEndByte: number,
21
+ startRow: number,
22
+ startCol: number,
23
+ oldEndRow: number,
24
+ oldEndCol: number,
25
+ newEndRow: number,
26
+ newEndCol: number,
27
+ }
28
+ export interface ParseError {
29
+ message: string,
30
+ }
@@ -0,0 +1,2 @@
1
+ /** @module Interface wasi:cli/environment@0.2.3 **/
2
+ export function getEnvironment(): Array<[string, string]>;
@@ -0,0 +1,3 @@
1
+ /** @module Interface wasi:cli/exit@0.2.3 **/
2
+ export function exit(status: Result<void, void>): void;
3
+ export type Result<T, E> = { tag: 'ok', val: T } | { tag: 'err', val: E };
@@ -0,0 +1,3 @@
1
+ /** @module Interface wasi:cli/stderr@0.2.3 **/
2
+ export function getStderr(): OutputStream;
3
+ export type OutputStream = import('./wasi-io-streams.js').OutputStream;
@@ -0,0 +1,3 @@
1
+ /** @module Interface wasi:cli/stdin@0.2.3 **/
2
+ export function getStdin(): InputStream;
3
+ export type InputStream = import('./wasi-io-streams.js').InputStream;
@@ -0,0 +1,3 @@
1
+ /** @module Interface wasi:cli/stdout@0.2.3 **/
2
+ export function getStdout(): OutputStream;
3
+ export type OutputStream = import('./wasi-io-streams.js').OutputStream;
@@ -0,0 +1,5 @@
1
+ /** @module Interface wasi:clocks/wall-clock@0.2.3 **/
2
+ export interface Datetime {
3
+ seconds: bigint,
4
+ nanoseconds: number,
5
+ }
@@ -0,0 +1,3 @@
1
+ /** @module Interface wasi:filesystem/preopens@0.2.3 **/
2
+ export function getDirectories(): Array<[Descriptor, string]>;
3
+ export type Descriptor = import('./wasi-filesystem-types.js').Descriptor;
@@ -0,0 +1,124 @@
1
+ /** @module Interface wasi:filesystem/types@0.2.3 **/
2
+ export function filesystemErrorCode(err: Error): ErrorCode | undefined;
3
+ export type Filesize = bigint;
4
+ export type OutputStream = import('./wasi-io-streams.js').OutputStream;
5
+ /**
6
+ * # Variants
7
+ *
8
+ * ## `"access"`
9
+ *
10
+ * ## `"would-block"`
11
+ *
12
+ * ## `"already"`
13
+ *
14
+ * ## `"bad-descriptor"`
15
+ *
16
+ * ## `"busy"`
17
+ *
18
+ * ## `"deadlock"`
19
+ *
20
+ * ## `"quota"`
21
+ *
22
+ * ## `"exist"`
23
+ *
24
+ * ## `"file-too-large"`
25
+ *
26
+ * ## `"illegal-byte-sequence"`
27
+ *
28
+ * ## `"in-progress"`
29
+ *
30
+ * ## `"interrupted"`
31
+ *
32
+ * ## `"invalid"`
33
+ *
34
+ * ## `"io"`
35
+ *
36
+ * ## `"is-directory"`
37
+ *
38
+ * ## `"loop"`
39
+ *
40
+ * ## `"too-many-links"`
41
+ *
42
+ * ## `"message-size"`
43
+ *
44
+ * ## `"name-too-long"`
45
+ *
46
+ * ## `"no-device"`
47
+ *
48
+ * ## `"no-entry"`
49
+ *
50
+ * ## `"no-lock"`
51
+ *
52
+ * ## `"insufficient-memory"`
53
+ *
54
+ * ## `"insufficient-space"`
55
+ *
56
+ * ## `"not-directory"`
57
+ *
58
+ * ## `"not-empty"`
59
+ *
60
+ * ## `"not-recoverable"`
61
+ *
62
+ * ## `"unsupported"`
63
+ *
64
+ * ## `"no-tty"`
65
+ *
66
+ * ## `"no-such-device"`
67
+ *
68
+ * ## `"overflow"`
69
+ *
70
+ * ## `"not-permitted"`
71
+ *
72
+ * ## `"pipe"`
73
+ *
74
+ * ## `"read-only"`
75
+ *
76
+ * ## `"invalid-seek"`
77
+ *
78
+ * ## `"text-file-busy"`
79
+ *
80
+ * ## `"cross-device"`
81
+ */
82
+ export type ErrorCode = 'access' | 'would-block' | 'already' | 'bad-descriptor' | 'busy' | 'deadlock' | 'quota' | 'exist' | 'file-too-large' | 'illegal-byte-sequence' | 'in-progress' | 'interrupted' | 'invalid' | 'io' | 'is-directory' | 'loop' | 'too-many-links' | 'message-size' | 'name-too-long' | 'no-device' | 'no-entry' | 'no-lock' | 'insufficient-memory' | 'insufficient-space' | 'not-directory' | 'not-empty' | 'not-recoverable' | 'unsupported' | 'no-tty' | 'no-such-device' | 'overflow' | 'not-permitted' | 'pipe' | 'read-only' | 'invalid-seek' | 'text-file-busy' | 'cross-device';
83
+ /**
84
+ * # Variants
85
+ *
86
+ * ## `"unknown"`
87
+ *
88
+ * ## `"block-device"`
89
+ *
90
+ * ## `"character-device"`
91
+ *
92
+ * ## `"directory"`
93
+ *
94
+ * ## `"fifo"`
95
+ *
96
+ * ## `"symbolic-link"`
97
+ *
98
+ * ## `"regular-file"`
99
+ *
100
+ * ## `"socket"`
101
+ */
102
+ export type DescriptorType = 'unknown' | 'block-device' | 'character-device' | 'directory' | 'fifo' | 'symbolic-link' | 'regular-file' | 'socket';
103
+ export type LinkCount = bigint;
104
+ export type Datetime = import('./wasi-clocks-wall-clock.js').Datetime;
105
+ export interface DescriptorStat {
106
+ type: DescriptorType,
107
+ linkCount: LinkCount,
108
+ size: Filesize,
109
+ dataAccessTimestamp?: Datetime,
110
+ dataModificationTimestamp?: Datetime,
111
+ statusChangeTimestamp?: Datetime,
112
+ }
113
+ export type Error = import('./wasi-io-streams.js').Error;
114
+
115
+ export class Descriptor {
116
+ /**
117
+ * This type does not have a public constructor.
118
+ */
119
+ private constructor();
120
+ writeViaStream(offset: Filesize): OutputStream;
121
+ appendViaStream(): OutputStream;
122
+ getType(): DescriptorType;
123
+ stat(): DescriptorStat;
124
+ }
@@ -0,0 +1,8 @@
1
+ /** @module Interface wasi:io/error@0.2.3 **/
2
+
3
+ export class Error {
4
+ /**
5
+ * This type does not have a public constructor.
6
+ */
7
+ private constructor();
8
+ }
@@ -0,0 +1,28 @@
1
+ /** @module Interface wasi:io/streams@0.2.3 **/
2
+ export type Error = import('./wasi-io-error.js').Error;
3
+ export type StreamError = StreamErrorLastOperationFailed | StreamErrorClosed;
4
+ export interface StreamErrorLastOperationFailed {
5
+ tag: 'last-operation-failed',
6
+ val: Error,
7
+ }
8
+ export interface StreamErrorClosed {
9
+ tag: 'closed',
10
+ }
11
+
12
+ export class InputStream {
13
+ /**
14
+ * This type does not have a public constructor.
15
+ */
16
+ private constructor();
17
+ }
18
+
19
+ export class OutputStream {
20
+ /**
21
+ * This type does not have a public constructor.
22
+ */
23
+ private constructor();
24
+ checkWrite(): bigint;
25
+ write(contents: Uint8Array): void;
26
+ blockingWriteAndFlush(contents: Uint8Array): void;
27
+ blockingFlush(): void;
28
+ }
@@ -0,0 +1,2 @@
1
+ /** @module Interface wasi:random/random@0.2.3 **/
2
+ export function getRandomBytes(len: bigint): Uint8Array;
package/package.json ADDED
@@ -0,0 +1,43 @@
1
+ {
2
+ "name": "@arborium/php",
3
+ "version": "0.3.0",
4
+ "description": "Arborium syntax highlighting grammar for php",
5
+ "type": "module",
6
+ "main": "./grammar.js",
7
+ "module": "./grammar.js",
8
+ "types": "./grammar.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "import": "./grammar.js",
12
+ "types": "./grammar.d.ts"
13
+ },
14
+ "./grammar.js": "./grammar.js",
15
+ "./grammar.core.wasm": "./grammar.core.wasm"
16
+ },
17
+ "files": [
18
+ "grammar.js",
19
+ "grammar.d.ts",
20
+ "grammar.core.wasm",
21
+ "interfaces"
22
+ ],
23
+ "keywords": [
24
+ "arborium",
25
+ "syntax-highlighting",
26
+ "tree-sitter",
27
+ "php",
28
+ "wasm"
29
+ ],
30
+ "author": "Amos Wenger <amos@bearcove.net>",
31
+ "license": "MIT OR Apache-2.0",
32
+ "repository": {
33
+ "type": "git",
34
+ "url": "git+https://github.com/bearcove/arborium.git"
35
+ },
36
+ "homepage": "https://github.com/bearcove/arborium",
37
+ "bugs": {
38
+ "url": "https://github.com/bearcove/arborium/issues"
39
+ },
40
+ "publishConfig": {
41
+ "access": "public"
42
+ }
43
+ }