| 84 | } |
| 85 | |
| 86 | function parseThemeOptions(params: string) { |
| 87 | let options = ThemeOptions.NONE |
| 88 | let prefix = null |
| 89 | |
| 90 | for (let option of segment(params, ' ')) { |
| 91 | if (option === 'reference') { |
| 92 | options |= ThemeOptions.REFERENCE |
| 93 | } else if (option === 'inline') { |
| 94 | options |= ThemeOptions.INLINE |
| 95 | } else if (option === 'default') { |
| 96 | options |= ThemeOptions.DEFAULT |
| 97 | } else if (option === 'static') { |
| 98 | options |= ThemeOptions.STATIC |
| 99 | } else if (option.startsWith('prefix(') && option.endsWith(')')) { |
| 100 | prefix = option.slice(7, -1) |
| 101 | } |
| 102 | } |
| 103 | |
| 104 | return [options, prefix] as const |
| 105 | } |
| 106 | |
| 107 | type Root = |
| 108 | // Unknown root |