generated from espanso/espanso-external-repo-template
-
Notifications
You must be signed in to change notification settings - Fork 14
/
typescript.json
82 lines (82 loc) · 1.69 KB
/
typescript.json
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
{
"Print to console": {
"prefix": "clg",
"body": [
"console.log('$1');",
"$2"
],
"description": "Log output to console"
},
"JSON Stringify HTML": {
"prefix": "jss",
"body": [
"<pre style={{ height: \"200px\", overflow: \"auto\" }}><code>{JSON.stringify($1, null, 2)}</code></pre>"
],
"description": "JSON Stringify HTML"
},
"Export function": {
"prefix": "ef",
"body": [
"export function $1($2): $3 {",
" $4",
"}"
],
"description": "Export function"
},
"Export const": {
"prefix": "expc",
"body": [
"type Props = {",
" $2",
"}",
"",
"export const $1 = ({ $3 }: Props) => {",
" return (",
" $4",
" );",
"};"
],
"description": "Export const"
},
"Export default function": {
"prefix": "edf",
"body": [
"export default function $1($2) {",
" $4",
"}"
],
"description": "Export default function"
},
"Export default graphql const": {
"prefix": "edgc",
"body": [
"import { graphql } from \"@/lib/gql\";",
"",
"export const $1 = graphql(`",
" $2",
"`);",
""
],
"description": "Export default graphql const"
},
"Export default graphql hook": {
"prefix": "edgh",
"body": [
"import { useGqlQuery } from \"@/lib/gql\";",
"",
"type Props = {",
" $2",
"};",
"",
"export const $1 = ({ $3 }: Props) => {",
"const query = useGqlQuery({",
"document: $4,",
"variables: undefined",
"});",
"",
"return { ...query };",
"};"
],
"description": "Export default graphql hook"
}
}