-
Notifications
You must be signed in to change notification settings - Fork 6
/
knit.code-snippets
74 lines (74 loc) · 1.58 KB
/
knit.code-snippets
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
{
"Knit Service": {
"prefix": ["knitservice"],
"body": [
"import { KnitServer as Knit } from \"@rbxts/knit\";",
"",
"declare global {",
"\tinterface KnitServices {",
"\t\t${0:$TM_FILENAME_BASE}: typeof ${0:$TM_FILENAME_BASE};",
"\t}",
"}",
"",
"const ${0:$TM_FILENAME_BASE} = Knit.CreateService({",
"\tName: \"${0:$TM_FILENAME_BASE}\",",
"",
"\tClient: {",
"\t},",
"",
"\tKnitInit() {",
"\t},",
"",
"\tKnitStart() {",
"\t},",
"});",
"",
"export = ${0:$TM_FILENAME_BASE};"
],
"description": "Knit Service template"
},
"Knit Controller": {
"prefix": ["knitcontroller"],
"body": [
"import { KnitClient as Knit } from \"@rbxts/knit\";",
"",
"declare global {",
"\tinterface KnitControllers {",
"\t\t${0:$TM_FILENAME_BASE}: typeof ${0:$TM_FILENAME_BASE};",
"\t}",
"}",
"",
"const ${0:$TM_FILENAME_BASE} = Knit.CreateController({",
"\tName: \"${0:$TM_FILENAME_BASE}\",",
"",
"\tKnitInit() {",
"\t},",
"",
"\tKnitStart() {",
"\t},",
"});",
"",
"export = ${0:$TM_FILENAME_BASE};"
],
"description": "Knit Controller template"
},
"Knit Component": {
"prefix": ["knitcomponent"],
"body": [
"import { Component } from \"@rbxts/knit\";",
"",
"class ${0:$TM_FILENAME_BASE} implements Component.ComponentClass {",
"\tpublic static Tag = \"${0:$TM_FILENAME_BASE}\";",
"",
"\tconstructor(instance: Instance) {",
"\t}",
"",
"\tpublic Destroy() {",
"\t}",
"}",
"",
"export = ${0:$TM_FILENAME_BASE};",
],
"description": "Knit Component template"
}
}