PluginProbe
Code Snippets / 3.10.2
Code Snippets v3.10.2
4.0.0-beta.2 3.10.2 3.10.1 3.10.0 3.10.0-beta.2 3.10.0-beta.1 4.0.0-beta.1 3.9.6 trunk 2.10.0 2.10.1 2.12.0 2.12.1 2.13.0 2.13.1 2.13.2 2.13.3 2.14.0 2.14.1 2.14.2 2.14.3 2.14.4 2.14.5 2.14.6 3.0.0 All 65 releases
code-snippets / js / types / Snippet.ts

Snippet.ts in Code Snippets 3.10.2, at js/types/Snippet.ts

36 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 export interface Snippet {
2 readonly id: number
3 readonly name: string
4 readonly desc: string
5 readonly code: string
6 readonly tags: string[]
7 readonly scope: SnippetScope
8 readonly priority: number
9 readonly active: boolean
10 readonly locked: boolean
11 readonly trashed: boolean
12 readonly network: boolean
13 readonly shared_network?: boolean | null
14 readonly modified?: string
15 readonly conditionId: number
16 readonly lastActive?: number
17 readonly code_error?: readonly [string, number] | null
18 readonly code_error_trace?: string | null
19 }
20
21 export const SNIPPET_TYPES = <const> ['php', 'html', 'css', 'js', 'cond']
22 export type SnippetType = typeof SNIPPET_TYPES[number]
23
24 export type SnippetCodeType = 'php' | 'html' | 'css' | 'js'
25
26 export type SnippetCodeScope = typeof SNIPPET_TYPE_SCOPES[SnippetCodeType][number]
27 export type SnippetScope = typeof SNIPPET_TYPE_SCOPES[SnippetType][number]
28
29 export const SNIPPET_TYPE_SCOPES = <const> {
30 php: ['global', 'admin', 'front-end', 'single-use'],
31 html: ['content', 'head-content', 'body-content', 'footer-content'],
32 css: ['admin-css', 'site-css'],
33 js: ['site-head-js', 'site-footer-js'],
34 cond: ['condition']
35 }
36