Skip to content

Commit bdd1142

Browse files
committed
linting fixed
1 parent 2badfbd commit bdd1142

3 files changed

Lines changed: 24 additions & 40 deletions

File tree

src/processors/gridset/resolver.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { isSymbolReference, parseSymbolReference } from './symbols';
1+
import { isSymbolReference, parseSymbolReference, type SymbolReference } from './symbols';
22

33
function normalizeZipPathLocal(p: string): string {
44
const unified = p.replace(/\\/g, '/');
@@ -141,7 +141,7 @@ export function isSymbolLibraryReference(imageName?: string): boolean {
141141
* @param imageName - Image reference from Grid 3
142142
* @returns Parsed reference or null if not a symbol reference
143143
*/
144-
export function parseImageSymbolReference(imageName: string) {
144+
export function parseImageSymbolReference(imageName: string): SymbolReference | null {
145145
if (!isSymbolLibraryReference(imageName)) {
146146
return null;
147147
}

src/processors/gridsetProcessor.ts

Lines changed: 21 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -23,28 +23,10 @@ import crypto from 'crypto';
2323
import zlib from 'zlib';
2424
import { GridsetValidator } from '../validation/gridsetValidator';
2525
import { ValidationResult } from '../validation/validationTypes';
26-
// New imports for enhanced Grid 3 support
27-
import { CellBackgroundShape } from './gridset/styleHelpers';
28-
import { detectPluginCellType, Grid3PluginMetadata, Grid3CellType } from './gridset/pluginTypes';
29-
import {
30-
detectCommand,
31-
getCommandDefinition,
32-
Grid3CommandCategory,
33-
GRID3_COMMANDS,
34-
getAllCommandIds,
35-
getAllPluginIds,
36-
} from './gridset/commands';
37-
import {
38-
isSymbolReference,
39-
parseSymbolReference,
40-
resolveSymbolReference,
41-
getSymbolLibraryDisplayName,
42-
type SymbolReference,
43-
} from './gridset/symbols';
44-
import {
45-
isSymbolLibraryReference,
46-
parseImageSymbolReference,
47-
} from './gridset/resolver';
26+
import { detectCommand } from './gridset/commands';
27+
import { parseSymbolReference, type SymbolReference } from './gridset/symbols';
28+
import { isSymbolLibraryReference } from './gridset/resolver';
29+
import { detectPluginCellType, Grid3CellType } from './gridset/pluginTypes';
4830

4931
class GridsetProcessor extends BaseProcessor {
5032
constructor(options?: ProcessorOptions) {
@@ -299,9 +281,10 @@ class GridsetProcessor extends BaseProcessor {
299281
fontColor: grid3Style.FontColour,
300282
fontFamily: grid3Style.FontName,
301283
fontSize: grid3Style.FontSize ? parseInt(String(grid3Style.FontSize)) : undefined,
302-
backgroundShape: grid3Style.BackgroundShape !== undefined
303-
? parseInt(String(grid3Style.BackgroundShape))
304-
: undefined,
284+
backgroundShape:
285+
grid3Style.BackgroundShape !== undefined
286+
? parseInt(String(grid3Style.BackgroundShape))
287+
: undefined,
305288
};
306289
}
307290

@@ -599,7 +582,7 @@ class GridsetProcessor extends BaseProcessor {
599582

600583
if (commands) {
601584
const commandArr = Array.isArray(commands) ? commands : [commands];
602-
detectedCommands = commandArr.map(cmd => detectCommand(cmd));
585+
detectedCommands = commandArr.map((cmd) => detectCommand(cmd));
603586

604587
for (const command of commandArr) {
605588
const commandId = command['@_ID'] || command.ID || command.id;
@@ -1009,14 +992,18 @@ class GridsetProcessor extends BaseProcessor {
1009992
y: cellY,
1010993
columnSpan: colSpan,
1011994
rowSpan: rowSpan,
1012-
contentType: pluginMetadata.cellType === Grid3CellType.Regular
1013-
? 'Normal'
1014-
: pluginMetadata.cellType === Grid3CellType.Workspace
1015-
? 'Workspace'
1016-
: pluginMetadata.cellType === Grid3CellType.LiveCell
1017-
? 'LiveCell'
1018-
: 'AutoContent',
1019-
contentSubType: pluginMetadata.subType || pluginMetadata.liveCellType || pluginMetadata.autoContentType,
995+
contentType:
996+
pluginMetadata.cellType === Grid3CellType.Regular
997+
? 'Normal'
998+
: pluginMetadata.cellType === Grid3CellType.Workspace
999+
? 'Workspace'
1000+
: pluginMetadata.cellType === Grid3CellType.LiveCell
1001+
? 'LiveCell'
1002+
: 'AutoContent',
1003+
contentSubType:
1004+
pluginMetadata.subType ||
1005+
pluginMetadata.liveCellType ||
1006+
pluginMetadata.autoContentType,
10201007
symbolLibrary: symbolLibraryRef?.library || undefined,
10211008
symbolPath: symbolLibraryRef?.path || undefined,
10221009
style: {

src/processors/index.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,7 @@ export {
144144
export { isSymbolLibraryReference, parseImageSymbolReference } from './gridset/resolver';
145145

146146
// Backward compatibility
147-
export {
148-
getSymbolsDir,
149-
getSymbolSearchDir,
150-
} from './gridset/symbols';
147+
export { getSymbolsDir, getSymbolSearchDir } from './gridset/symbols';
151148

152149
// Gridset (Grid 3) symbol extraction for conversion
153150
export {

0 commit comments

Comments
 (0)