-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlost.code-snippets
More file actions
97 lines (97 loc) · 2.45 KB
/
lost.code-snippets
File metadata and controls
97 lines (97 loc) · 2.45 KB
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
{
"LostPlugin": {
"prefix": "!plugin",
"body": [
"import { defineAddon, Plugin, Property } from 'jsr:@lost-c3/lib${1:@Version}';",
"import type { EditorInstance } from '@Editor/Instance.ts';",
"import type { EditorType } from '@Editor/Type.ts';",
"import config from './lost.config.ts';",
"",
"",
"export default defineAddon(",
" new Plugin<EditorInstance, EditorType>(config)",
" /** @Properties */",
" ${2:}",
")"
],
"description": "Creates structure for 'addon.ts' file for 'plugin' addon type"
},
"LostBehavior": {
"prefix": "!plugin",
"body": [
"import { defineAddon, Behavior, Property } from 'jsr:@lost-c3/lib${1:@Version}';",
"import config from './lost.config.ts';",
"",
"",
"export default defineAddon(",
" new Behavior(config)",
" /** @Properties */",
" ${2:}",
")"
],
"description": "Creates structure for 'addon.ts' file for 'behavior' addon type"
},
"LostCategory": {
"prefix": "!cc",
"body": [
"import { Category, Action, Condition, Expression, addParam, Param } from 'jsr:@lost-c3/lib${1:@Version}';",
"import type { Instance } from '../Instance.ts';",
"",
"@Category('${2:categoryId}', '${3:Category Name}')",
"export default class {",
" /** @Actions */",
" ${4:}",
" /** @Conditions */",
" ${5:}",
" /** @Expressions */",
" ${6:}",
"}",
],
"description": "Creates empty category structure"
},
"LostAction": {
"prefix": "!ea",
"body": [
"@Action(",
" `${1:id}`,",
" `${2:name}`,",
" `${3:displayText}`,",
" `${4:description}`, {",
" params: [${5:}]",
"})",
"${1:doAction}(this: Instance, ${6:params}: ${7:type}) {",
" ${8:}",
"};"
],
"description": "Creates action entity"
},
"LostCondition": {
"prefix": "!ec",
"body": [
"@Condition(",
" `${1:id}`,",
" `${2:name}`,",
" `${3:displayText}`,",
" `${4:description}`, {",
" isTrigger: ${5:true}",
"})",
"${1:onCondition}(this: Instance) { return ${6:true} };"
],
"description": "Creates condition entity"
},
"LostExpression": {
"prefix": "!ee",
"body": [
"@Expression(",
" `${1:id}`,",
" `${1:nameAndDisplayText}`,",
" `${2:description}`, {",
" returnType: '${3:string}'",
"})",
"${1:Expression}(this: Instance) {",
" return '${4:}';",
"};"
],
"description": "Creates expression entity"
}
}