| @@ -6,17 +6,31 @@ | ||
| 6 | 6 | readonly tags: string[] |
| 7 | 7 | readonly scope: SnippetScope |
| 8 | 8 | readonly priority: number |
| 9 | 9 | readonly active: boolean |
| 10 | + readonly locked: boolean | |
| 11 | + readonly trashed: boolean | |
| 10 | 12 | readonly network: boolean |
| 11 | 13 | readonly shared_network?: boolean | null |
| 12 | 14 | readonly modified?: string |
| 13 | 15 | readonly conditionId: number |
| 16 | + readonly lastActive?: number | |
| 14 | 17 | readonly code_error?: readonly [string, number] | null |
| 18 | + readonly code_error_trace?: string | null | |
| 19 | + readonly createdBy?: SnippetAuthor | null | |
| 20 | + readonly updatedBy?: SnippetAuthor | null | |
| 15 | 21 | } |
| 16 | 22 | |
| 23 | +export interface SnippetAuthor { | |
| 24 | + readonly id: number | |
| 25 | + readonly displayName: string | |
| 26 | + readonly avatarUrl: string | |
| 27 | +} | |
| 28 | + | |
| 29 | +export const SNIPPET_TYPES = <const> ['php', 'html', 'css', 'js', 'cond'] | |
| 30 | +export type SnippetType = typeof SNIPPET_TYPES[number] | |
| 31 | + | |
| 17 | 32 | export type SnippetCodeType = 'php' | 'html' | 'css' | 'js' |
| 18 | -export type SnippetType = SnippetCodeType | 'cond' | |
| 19 | 33 | |
| 20 | 34 | export type SnippetCodeScope = typeof SNIPPET_TYPE_SCOPES[SnippetCodeType][number] |
| 21 | 35 | export type SnippetScope = typeof SNIPPET_TYPE_SCOPES[SnippetType][number] |
| 22 | 36 | |
| @@ -21,9 +35,9 @@ | ||
| 21 | 35 | export type SnippetScope = typeof SNIPPET_TYPE_SCOPES[SnippetType][number] |
| 22 | 36 | |
| 23 | 37 | export const SNIPPET_TYPE_SCOPES = <const> { |
| 24 | 38 | php: ['global', 'admin', 'front-end', 'single-use'], |
| 25 | - html: ['content', 'head-content', 'footer-content'], | |
| 39 | + html: ['content', 'head-content', 'body-content', 'footer-content'], | |
| 26 | 40 | css: ['admin-css', 'site-css'], |
| 27 | 41 | js: ['site-head-js', 'site-footer-js'], |
| 28 | 42 | cond: ['condition'] |
| 29 | 43 | } |