uudev 1.2.0 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dtstype/acc.d.ts +1 -2
- package/dtstype/excel.d.ts +21 -80
- package/dtstype/ppt.d.ts +41 -0
- package/dtstype/word.d.ts +2 -3
- package/main.js +4 -4
- package/package.json +1 -1
package/dtstype/acc.d.ts
CHANGED
|
@@ -2930,7 +2930,6 @@ interface DataAccessPage{
|
|
|
2930
2930
|
readonly WebOptions: WebOptions;
|
|
2931
2931
|
ConnectionString: string;
|
|
2932
2932
|
readonly FieldListConnection: object | any;
|
|
2933
|
-
readonly MailEnvelope: MsoEnvelopeVB;
|
|
2934
2933
|
readonly CurrentSelection: object | any;
|
|
2935
2934
|
readonly MSODSC: object | any;
|
|
2936
2935
|
RemovePersonalInformation: boolean;
|
|
@@ -5101,4 +5100,4 @@ interface Edge{
|
|
|
5101
5100
|
Refresh(): void;
|
|
5102
5101
|
}
|
|
5103
5102
|
|
|
5104
|
-
declare const Application: Application & base.Application;
|
|
5103
|
+
declare const Application: Application & base.Application;
|
package/dtstype/excel.d.ts
CHANGED
|
@@ -300,14 +300,14 @@ interface Font{
|
|
|
300
300
|
interface Window{
|
|
301
301
|
readonly Application: Application;
|
|
302
302
|
readonly Creator: XlCreator;
|
|
303
|
-
readonly Parent:
|
|
303
|
+
readonly Parent: Workbook;
|
|
304
304
|
Activate(): any;
|
|
305
305
|
ActivateNext(): any;
|
|
306
306
|
ActivatePrevious(): any;
|
|
307
307
|
readonly ActiveCell: Range;
|
|
308
308
|
readonly ActiveChart: Chart;
|
|
309
309
|
readonly ActivePane: Pane;
|
|
310
|
-
readonly ActiveSheet:
|
|
310
|
+
readonly ActiveSheet: Worksheet & Chart & DialogSheet;
|
|
311
311
|
Caption: any;
|
|
312
312
|
Close(SaveChanges?: any, Filename?: any, RouteWorkbook?: any): boolean;
|
|
313
313
|
DisplayFormulas: boolean;
|
|
@@ -337,7 +337,7 @@ interface Window{
|
|
|
337
337
|
ScrollRow: number;
|
|
338
338
|
ScrollWorkbookTabs(Sheets?: any, Position?: any): any;
|
|
339
339
|
readonly SelectedSheets: Sheets;
|
|
340
|
-
readonly Selection:
|
|
340
|
+
readonly Selection: Range & ShapeRange;
|
|
341
341
|
SmallScroll(Down?: any, Up?: any, ToRight?: any, ToLeft?: any): any;
|
|
342
342
|
Split: boolean;
|
|
343
343
|
SplitColumn: number;
|
|
@@ -381,62 +381,6 @@ interface Windows{
|
|
|
381
381
|
SyncScrollingSideBySide: boolean;
|
|
382
382
|
ResetPositionsSideBySide(): void;
|
|
383
383
|
}
|
|
384
|
-
interface AppEvents{
|
|
385
|
-
NewWorkbook(Wb: Workbook): void;
|
|
386
|
-
SheetSelectionChange(Sh: object | any, Target: Range): void;
|
|
387
|
-
SheetBeforeDoubleClick(Sh: object | any, Target: Range, Cancel: boolean): void;
|
|
388
|
-
SheetBeforeRightClick(Sh: object | any, Target: Range, Cancel: boolean): void;
|
|
389
|
-
SheetActivate(Sh: object | any): void;
|
|
390
|
-
SheetDeactivate(Sh: object | any): void;
|
|
391
|
-
SheetCalculate(Sh: object | any): void;
|
|
392
|
-
SheetChange(Sh: object | any, Target: Range): void;
|
|
393
|
-
WorkbookOpen(Wb: Workbook): void;
|
|
394
|
-
WorkbookActivate(Wb: Workbook): void;
|
|
395
|
-
WorkbookDeactivate(Wb: Workbook): void;
|
|
396
|
-
WorkbookBeforeClose(Wb: Workbook, Cancel: boolean): void;
|
|
397
|
-
WorkbookBeforeSave(Wb: Workbook, SaveAsUI: boolean, Cancel: boolean): void;
|
|
398
|
-
WorkbookBeforePrint(Wb: Workbook, Cancel: boolean): void;
|
|
399
|
-
WorkbookNewSheet(Wb: Workbook, Sh: object | any): void;
|
|
400
|
-
WorkbookAddinInstall(Wb: Workbook): void;
|
|
401
|
-
WorkbookAddinUninstall(Wb: Workbook): void;
|
|
402
|
-
WindowResize(Wb: Workbook, Wn: Window): void;
|
|
403
|
-
WindowActivate(Wb: Workbook, Wn: Window): void;
|
|
404
|
-
WindowDeactivate(Wb: Workbook, Wn: Window): void;
|
|
405
|
-
SheetFollowHyperlink(Sh: object | any, Target: Hyperlink): void;
|
|
406
|
-
SheetPivotTableUpdate(Sh: object | any, Target: PivotTable): void;
|
|
407
|
-
WorkbookPivotTableCloseConnection(Wb: Workbook, Target: PivotTable): void;
|
|
408
|
-
WorkbookPivotTableOpenConnection(Wb: Workbook, Target: PivotTable): void;
|
|
409
|
-
WorkbookSync(Wb: Workbook, SyncEventType: MsoSyncEventType): void;
|
|
410
|
-
WorkbookBeforeXmlImport(Wb: Workbook, Map: XmlMap, Url: string, IsRefresh: boolean, Cancel: boolean): void;
|
|
411
|
-
WorkbookAfterXmlImport(Wb: Workbook, Map: XmlMap, IsRefresh: boolean, Result: XlXmlImportResult): void;
|
|
412
|
-
WorkbookBeforeXmlExport(Wb: Workbook, Map: XmlMap, Url: string, Cancel: boolean): void;
|
|
413
|
-
WorkbookAfterXmlExport(Wb: Workbook, Map: XmlMap, Url: string, Result: XlXmlExportResult): void;
|
|
414
|
-
WorkbookRowsetComplete(Wb: Workbook, Description: string, Sheet: string, Success: boolean): void;
|
|
415
|
-
AfterCalculate(): void;
|
|
416
|
-
SheetPivotTableAfterValueChange(Sh: object | any, TargetPivotTable: PivotTable, TargetRange: Range): void;
|
|
417
|
-
SheetPivotTableBeforeAllocateChanges(Sh: object | any, TargetPivotTable: PivotTable, ValueChangeStart: number, ValueChangeEnd: number, Cancel: boolean): void;
|
|
418
|
-
SheetPivotTableBeforeCommitChanges(Sh: object | any, TargetPivotTable: PivotTable, ValueChangeStart: number, ValueChangeEnd: number, Cancel: boolean): void;
|
|
419
|
-
SheetPivotTableBeforeDiscardChanges(Sh: object | any, TargetPivotTable: PivotTable, ValueChangeStart: number, ValueChangeEnd: number): void;
|
|
420
|
-
ProtectedViewWindowOpen(Pvw: ProtectedViewWindow): void;
|
|
421
|
-
ProtectedViewWindowBeforeEdit(Pvw: ProtectedViewWindow, Cancel: boolean): void;
|
|
422
|
-
ProtectedViewWindowBeforeClose(Pvw: ProtectedViewWindow, Reason: XlProtectedViewCloseReason, Cancel: boolean): void;
|
|
423
|
-
ProtectedViewWindowResize(Pvw: ProtectedViewWindow): void;
|
|
424
|
-
ProtectedViewWindowActivate(Pvw: ProtectedViewWindow): void;
|
|
425
|
-
ProtectedViewWindowDeactivate(Pvw: ProtectedViewWindow): void;
|
|
426
|
-
WorkbookAfterSave(Wb: Workbook, Success: boolean): void;
|
|
427
|
-
WorkbookNewChart(Wb: Workbook, Ch: Chart): void;
|
|
428
|
-
SheetLensGalleryRenderComplete(Sh: object | any): void;
|
|
429
|
-
SheetTableUpdate(Sh: object | any, Target: TableObject): void;
|
|
430
|
-
WorkbookModelChange(Wb: Workbook, Changes: ModelChanges): void;
|
|
431
|
-
SheetBeforeDelete(Sh: object | any): void;
|
|
432
|
-
WorkbookBeforeRemoteChange(Wb: Workbook): void;
|
|
433
|
-
WorkbookAfterRemoteChange(Wb: Workbook): void;
|
|
434
|
-
RemoteSheetChange(Sh: object | any, Target: Range): void;
|
|
435
|
-
RemoteWorkbookNewSheet(Wb: Workbook, Sh: object | any): void;
|
|
436
|
-
RemoteWorkbookNewChart(Wb: Workbook, Ch: Chart): void;
|
|
437
|
-
RemoteSheetBeforeDelete(Sh: object | any): void;
|
|
438
|
-
RemoteSheetPivotTableUpdate(Sh: object | any, Target: PivotTable): void;
|
|
439
|
-
}
|
|
440
384
|
interface Application{
|
|
441
385
|
readonly Application: Application;
|
|
442
386
|
readonly Creator: XlCreator;
|
|
@@ -446,7 +390,7 @@ interface Application{
|
|
|
446
390
|
readonly ActiveDialog: DialogSheet;
|
|
447
391
|
readonly ActiveMenuBar: MenuBar;
|
|
448
392
|
ActivePrinter: string;
|
|
449
|
-
readonly ActiveSheet:
|
|
393
|
+
readonly ActiveSheet: Worksheet & Chart & DialogSheet;
|
|
450
394
|
readonly ActiveWindow: Window;
|
|
451
395
|
readonly ActiveWorkbook: Workbook;
|
|
452
396
|
readonly AddIns: AddIns;
|
|
@@ -474,7 +418,7 @@ interface Application{
|
|
|
474
418
|
readonly Rows: Range;
|
|
475
419
|
Run(Macro?: any, Arg1?: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): any;
|
|
476
420
|
_Run2(Macro?: any, Arg1?: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): any;
|
|
477
|
-
readonly Selection:
|
|
421
|
+
readonly Selection: Range & ShapeRange;
|
|
478
422
|
SendKeys(Keys: any, Wait?: any): void;
|
|
479
423
|
readonly Sheets: Sheets;
|
|
480
424
|
ShortcutMenus(Index: number): Menu;
|
|
@@ -1172,7 +1116,7 @@ interface WorksheetFunction{
|
|
|
1172
1116
|
interface Range{
|
|
1173
1117
|
readonly Application: Application;
|
|
1174
1118
|
readonly Creator: XlCreator;
|
|
1175
|
-
readonly Parent:
|
|
1119
|
+
readonly Parent: Worksheet;
|
|
1176
1120
|
Activate(): any;
|
|
1177
1121
|
AddIndent: any;
|
|
1178
1122
|
Address(RowAbsolute?: any, ColumnAbsolute?: any, ReferenceStyle?: XlReferenceStyle, External?: any, RelativeTo?: any): string;
|
|
@@ -1314,7 +1258,6 @@ interface Range{
|
|
|
1314
1258
|
UseStandardWidth: any;
|
|
1315
1259
|
readonly Validation: Validation;
|
|
1316
1260
|
Value: any;
|
|
1317
|
-
_Value(RangeValueDataType?: any, RHS?: any): void;
|
|
1318
1261
|
Value2: any;
|
|
1319
1262
|
VerticalAlignment: any;
|
|
1320
1263
|
readonly Width: any;
|
|
@@ -1383,6 +1326,7 @@ interface Range{
|
|
|
1383
1326
|
ClearContents(RemoveControls?: any): any;
|
|
1384
1327
|
ResetContents(): void;
|
|
1385
1328
|
RemoveControls(): void;
|
|
1329
|
+
_Value(RangeValueDataType?: any, RHS?: any): void;
|
|
1386
1330
|
}
|
|
1387
1331
|
interface ChartEvents{
|
|
1388
1332
|
Activate(): void;
|
|
@@ -1404,7 +1348,7 @@ interface ChartEvents{
|
|
|
1404
1348
|
interface Chart{
|
|
1405
1349
|
readonly Application: Application;
|
|
1406
1350
|
readonly Creator: XlCreator;
|
|
1407
|
-
readonly Parent:
|
|
1351
|
+
readonly Parent: Workbook;
|
|
1408
1352
|
Activate(): void;
|
|
1409
1353
|
Copy(Before?: any, After?: any): void;
|
|
1410
1354
|
Delete(): void;
|
|
@@ -1525,7 +1469,6 @@ interface Chart{
|
|
|
1525
1469
|
readonly Scripts: Scripts;
|
|
1526
1470
|
_PrintOut(From?: any, To?: any, Copies?: any, Preview?: any, ActivePrinter?: any, PrintToFile?: any, Collate?: any, PrToFileName?: any): void;
|
|
1527
1471
|
readonly Tab: Tab;
|
|
1528
|
-
readonly MailEnvelope: MsoEnvelopeVB;
|
|
1529
1472
|
ApplyDataLabels(Type?: XlDataLabelsType, LegendKey?: any, AutoText?: any, HasLeaderLines?: any, ShowSeriesName?: any, ShowCategoryName?: any, ShowValue?: any, ShowPercentage?: any, ShowBubbleSize?: any, Separator?: any): void;
|
|
1530
1473
|
_SaveAs(Filename: string, FileFormat?: any, Password?: any, WriteResPassword?: any, ReadOnlyRecommended?: any, CreateBackup?: any, AddToMru?: any, TextCodepage?: any, TextVisualLayout?: any, Local?: any): void;
|
|
1531
1474
|
Protect(Password?: any, DrawingObjects?: any, Contents?: any, Scenarios?: any, UserInterfaceOnly?: any): void;
|
|
@@ -1564,13 +1507,13 @@ interface Chart{
|
|
|
1564
1507
|
interface Sheets{
|
|
1565
1508
|
readonly Application: Application;
|
|
1566
1509
|
readonly Creator: XlCreator;
|
|
1567
|
-
readonly Parent:
|
|
1568
|
-
Add(Before?: any, After?: any, Count?: any, Type?: any):
|
|
1510
|
+
readonly Parent: Workbook;
|
|
1511
|
+
Add(Before?: any, After?: any, Count?: any, Type?: any): Worksheet & Chart & DialogSheet;
|
|
1569
1512
|
Copy(Before?: any, After?: any): void;
|
|
1570
1513
|
readonly Count: number;
|
|
1571
1514
|
Delete(): void;
|
|
1572
1515
|
FillAcrossSheets(Range: Range, Type?: XlFillWith): void;
|
|
1573
|
-
Item(Index:
|
|
1516
|
+
Item(Index: number | string): Worksheet & Chart & DialogSheet;
|
|
1574
1517
|
Move(Before?: any, After?: any): void;
|
|
1575
1518
|
__PrintOut(From?: any, To?: any, Copies?: any, Preview?: any, ActivePrinter?: any, PrintToFile?: any, Collate?: any): void;
|
|
1576
1519
|
PrintPreview(EnableChanges?: any): void;
|
|
@@ -1580,7 +1523,7 @@ interface Sheets{
|
|
|
1580
1523
|
Visible: any;
|
|
1581
1524
|
_PrintOut(From?: any, To?: any, Copies?: any, Preview?: any, ActivePrinter?: any, PrintToFile?: any, Collate?: any, PrToFileName?: any): void;
|
|
1582
1525
|
PrintOut(From?: any, To?: any, Copies?: any, Preview?: any, ActivePrinter?: any, PrintToFile?: any, Collate?: any, PrToFileName?: any, IgnorePrintAreas?: any): void;
|
|
1583
|
-
Add2(Before?: any, After?: any, Count?: any, NewLayout?: any):
|
|
1526
|
+
Add2(Before?: any, After?: any, Count?: any, NewLayout?: any): Worksheet & Chart & DialogSheet;
|
|
1584
1527
|
}
|
|
1585
1528
|
interface VPageBreak{
|
|
1586
1529
|
readonly Application: Application;
|
|
@@ -1663,7 +1606,7 @@ interface DocEvents{
|
|
|
1663
1606
|
interface Worksheet{
|
|
1664
1607
|
readonly Application: Application;
|
|
1665
1608
|
readonly Creator: XlCreator;
|
|
1666
|
-
readonly Parent:
|
|
1609
|
+
readonly Parent: Workbook;
|
|
1667
1610
|
Activate(): void;
|
|
1668
1611
|
Copy(Before?: any, After?: any): void;
|
|
1669
1612
|
Delete(): void;
|
|
@@ -1767,7 +1710,6 @@ interface Worksheet{
|
|
|
1767
1710
|
_PrintOut(From?: any, To?: any, Copies?: any, Preview?: any, ActivePrinter?: any, PrintToFile?: any, Collate?: any, PrToFileName?: any): void;
|
|
1768
1711
|
_CheckSpelling(CustomDictionary?: any, IgnoreUppercase?: any, AlwaysSuggest?: any, SpellLang?: any, IgnoreFinalYaa?: any, SpellScript?: any): void;
|
|
1769
1712
|
readonly Tab: Tab;
|
|
1770
|
-
readonly MailEnvelope: MsoEnvelopeVB;
|
|
1771
1713
|
_SaveAs(Filename: string, FileFormat?: any, Password?: any, WriteResPassword?: any, ReadOnlyRecommended?: any, CreateBackup?: any, AddToMru?: any, TextCodepage?: any, TextVisualLayout?: any, Local?: any): void;
|
|
1772
1714
|
readonly CustomProperties: CustomProperties;
|
|
1773
1715
|
readonly SmartTags: SmartTags;
|
|
@@ -2041,7 +1983,7 @@ interface Workbook{
|
|
|
2041
1983
|
AcceptLabelsInFormulas: boolean;
|
|
2042
1984
|
Activate(): void;
|
|
2043
1985
|
readonly ActiveChart: Chart;
|
|
2044
|
-
readonly ActiveSheet:
|
|
1986
|
+
readonly ActiveSheet: Worksheet & Chart & DialogSheet;
|
|
2045
1987
|
Author: string;
|
|
2046
1988
|
AutoUpdateFrequency: number;
|
|
2047
1989
|
AutoUpdateSaveChanges: boolean;
|
|
@@ -4507,7 +4449,7 @@ interface Modules{
|
|
|
4507
4449
|
interface DialogSheet{
|
|
4508
4450
|
readonly Application: Application;
|
|
4509
4451
|
readonly Creator: XlCreator;
|
|
4510
|
-
readonly Parent:
|
|
4452
|
+
readonly Parent: Workbook;
|
|
4511
4453
|
Activate(): void;
|
|
4512
4454
|
Copy(Before?: any, After?: any): void;
|
|
4513
4455
|
Delete(): void;
|
|
@@ -4583,7 +4525,6 @@ interface DialogSheet{
|
|
|
4583
4525
|
_PrintOut(From?: any, To?: any, Copies?: any, Preview?: any, ActivePrinter?: any, PrintToFile?: any, Collate?: any, PrToFileName?: any): void;
|
|
4584
4526
|
_CheckSpelling(CustomDictionary?: any, IgnoreUppercase?: any, AlwaysSuggest?: any, SpellLang?: any, IgnoreFinalYaa?: any, SpellScript?: any): void;
|
|
4585
4527
|
readonly Tab: Tab;
|
|
4586
|
-
readonly MailEnvelope: MsoEnvelopeVB;
|
|
4587
4528
|
_SaveAs(Filename: string, FileFormat?: any, Password?: any, WriteResPassword?: any, ReadOnlyRecommended?: any, CreateBackup?: any, AddToMru?: any, TextCodepage?: any, TextVisualLayout?: any, Local?: any): void;
|
|
4588
4529
|
readonly CustomProperties: CustomProperties;
|
|
4589
4530
|
readonly SmartTags: SmartTags;
|
|
@@ -4631,13 +4572,13 @@ interface DialogSheets{
|
|
|
4631
4572
|
interface Worksheets{
|
|
4632
4573
|
readonly Application: Application;
|
|
4633
4574
|
readonly Creator: XlCreator;
|
|
4634
|
-
readonly Parent:
|
|
4635
|
-
Add(Before?: any, After?: any, Count?: any, Type?: any):
|
|
4575
|
+
readonly Parent: Workbook;
|
|
4576
|
+
Add(Before?: any, After?: any, Count?: any, Type?: any): Worksheet & Chart & DialogSheet;
|
|
4636
4577
|
Copy(Before?: any, After?: any): void;
|
|
4637
4578
|
readonly Count: number;
|
|
4638
4579
|
Delete(): void;
|
|
4639
4580
|
FillAcrossSheets(Range: Range, Type?: XlFillWith): void;
|
|
4640
|
-
Item(Index: any):
|
|
4581
|
+
Item(Index: any): Worksheet;
|
|
4641
4582
|
Move(Before?: any, After?: any): void;
|
|
4642
4583
|
__PrintOut(From?: any, To?: any, Copies?: any, Preview?: any, ActivePrinter?: any, PrintToFile?: any, Collate?: any): void;
|
|
4643
4584
|
PrintPreview(EnableChanges?: any): void;
|
|
@@ -4647,7 +4588,7 @@ interface Worksheets{
|
|
|
4647
4588
|
Visible: any;
|
|
4648
4589
|
_PrintOut(From?: any, To?: any, Copies?: any, Preview?: any, ActivePrinter?: any, PrintToFile?: any, Collate?: any, PrToFileName?: any): void;
|
|
4649
4590
|
PrintOut(From?: any, To?: any, Copies?: any, Preview?: any, ActivePrinter?: any, PrintToFile?: any, Collate?: any, PrToFileName?: any, IgnorePrintAreas?: any): void;
|
|
4650
|
-
Add2(Before?: any, After?: any, Count?: any, NewLayout?: any):
|
|
4591
|
+
Add2(Before?: any, After?: any, Count?: any, NewLayout?: any): Worksheet & Chart & DialogSheet;
|
|
4651
4592
|
}
|
|
4652
4593
|
interface PageSetup{
|
|
4653
4594
|
readonly Application: Application;
|
|
@@ -7050,7 +6991,7 @@ interface SheetViews{
|
|
|
7050
6991
|
readonly Creator: XlCreator;
|
|
7051
6992
|
readonly Parent: object | any;
|
|
7052
6993
|
readonly Count: number;
|
|
7053
|
-
Item(Index: any):
|
|
6994
|
+
Item(Index: any): WorksheetView & ChartView;
|
|
7054
6995
|
}
|
|
7055
6996
|
interface OLEDBConnection{
|
|
7056
6997
|
readonly Application: Application;
|
|
@@ -8356,4 +8297,4 @@ interface Dummy{
|
|
|
8356
8297
|
interface CanvasShapes{
|
|
8357
8298
|
}
|
|
8358
8299
|
|
|
8359
|
-
declare const Application: Application & base.Application;
|
|
8300
|
+
declare const Application: Application & base.Application;
|
package/dtstype/ppt.d.ts
CHANGED
|
@@ -138,12 +138,14 @@ interface Selection{
|
|
|
138
138
|
interface DocumentWindows{
|
|
139
139
|
readonly Application: Application;
|
|
140
140
|
readonly Parent: object | any;
|
|
141
|
+
readonly Count: number;
|
|
141
142
|
Item(Index: number): DocumentWindow;
|
|
142
143
|
Arrange(arrangeStyle?: PpArrangeStyle): void;
|
|
143
144
|
}
|
|
144
145
|
interface SlideShowWindows{
|
|
145
146
|
readonly Application: Application;
|
|
146
147
|
readonly Parent: object | any;
|
|
148
|
+
readonly Count: number;
|
|
147
149
|
Item(Index: number): SlideShowWindow;
|
|
148
150
|
}
|
|
149
151
|
interface DocumentWindow{
|
|
@@ -261,6 +263,7 @@ interface SlideShowSettings{
|
|
|
261
263
|
interface NamedSlideShows{
|
|
262
264
|
readonly Application: Application;
|
|
263
265
|
readonly Parent: object | any;
|
|
266
|
+
readonly Count: number;
|
|
264
267
|
Item(Index: any): NamedSlideShow;
|
|
265
268
|
Add(Name: string, safeArrayOfSlideIDs: any): NamedSlideShow;
|
|
266
269
|
}
|
|
@@ -299,6 +302,7 @@ interface PrintRanges{
|
|
|
299
302
|
ClearAll(): void;
|
|
300
303
|
Item(Index: number): PrintRange;
|
|
301
304
|
readonly Parent: object | any;
|
|
305
|
+
readonly Count: number;
|
|
302
306
|
}
|
|
303
307
|
interface PrintRange{
|
|
304
308
|
readonly Application: Application;
|
|
@@ -310,6 +314,7 @@ interface PrintRange{
|
|
|
310
314
|
interface AddIns{
|
|
311
315
|
readonly Application: Application;
|
|
312
316
|
readonly Parent: object | any;
|
|
317
|
+
readonly Count: number;
|
|
313
318
|
Item(Index: any): AddIn;
|
|
314
319
|
Add(FileName: string): AddIn;
|
|
315
320
|
Remove(Index: any): void;
|
|
@@ -329,6 +334,7 @@ interface AddIn{
|
|
|
329
334
|
interface Presentations{
|
|
330
335
|
readonly Application: Application;
|
|
331
336
|
readonly Parent: object | any;
|
|
337
|
+
readonly Count: number;
|
|
332
338
|
Item(Index: any): Presentation;
|
|
333
339
|
Add(WithWindow?: MsoTriState): Presentation;
|
|
334
340
|
OpenOld(FileName: string, ReadOnly?: MsoTriState, Untitled?: MsoTriState, WithWindow?: MsoTriState): Presentation;
|
|
@@ -342,6 +348,7 @@ interface PresEvents{
|
|
|
342
348
|
interface Hyperlinks{
|
|
343
349
|
readonly Application: Application;
|
|
344
350
|
readonly Parent: object | any;
|
|
351
|
+
readonly Count: number;
|
|
345
352
|
Item(Index: number): Hyperlink;
|
|
346
353
|
}
|
|
347
354
|
interface Hyperlink{
|
|
@@ -372,12 +379,14 @@ interface PageSetup{
|
|
|
372
379
|
interface Fonts{
|
|
373
380
|
readonly Application: Application;
|
|
374
381
|
readonly Parent: object | any;
|
|
382
|
+
readonly Count: number;
|
|
375
383
|
Item(Index: any): Font;
|
|
376
384
|
Replace(Original: string, Replacement: string): void;
|
|
377
385
|
}
|
|
378
386
|
interface ExtraColors{
|
|
379
387
|
readonly Application: Application;
|
|
380
388
|
readonly Parent: object | any;
|
|
389
|
+
readonly Count: number;
|
|
381
390
|
Item(Index: number): number;
|
|
382
391
|
Add(Type: number): void;
|
|
383
392
|
Clear(): void;
|
|
@@ -385,6 +394,7 @@ interface ExtraColors{
|
|
|
385
394
|
interface Slides{
|
|
386
395
|
readonly Application: Application;
|
|
387
396
|
readonly Parent: object | any;
|
|
397
|
+
readonly Count: number;
|
|
388
398
|
Item(Index: any): Slide;
|
|
389
399
|
FindBySlideID(SlideID: number): Slide;
|
|
390
400
|
Add(Index: number, Layout: PpSlideLayout): Slide;
|
|
@@ -512,12 +522,14 @@ interface SldEvents{
|
|
|
512
522
|
interface ColorSchemes{
|
|
513
523
|
readonly Application: Application;
|
|
514
524
|
readonly Parent: object | any;
|
|
525
|
+
readonly Count: number;
|
|
515
526
|
Item(Index: number): ColorScheme;
|
|
516
527
|
Add(Scheme?: ColorScheme): ColorScheme;
|
|
517
528
|
}
|
|
518
529
|
interface ColorScheme{
|
|
519
530
|
readonly Application: Application;
|
|
520
531
|
readonly Parent: object | any;
|
|
532
|
+
readonly Count: number;
|
|
521
533
|
Colors(SchemeColor: PpColorSchemeIndex): RGBColor;
|
|
522
534
|
Delete(): void;
|
|
523
535
|
}
|
|
@@ -608,6 +620,7 @@ interface Shapes{
|
|
|
608
620
|
interface Placeholders{
|
|
609
621
|
readonly Application: Application;
|
|
610
622
|
readonly Parent: object | any;
|
|
623
|
+
readonly Count: number;
|
|
611
624
|
Item(Index: number): Shape;
|
|
612
625
|
FindByName(Index: any): Shape;
|
|
613
626
|
}
|
|
@@ -1100,6 +1113,7 @@ interface LinkFormat{
|
|
|
1100
1113
|
interface ObjectVerbs{
|
|
1101
1114
|
readonly Application: Application;
|
|
1102
1115
|
readonly Parent: object | any;
|
|
1116
|
+
readonly Count: number;
|
|
1103
1117
|
Item(Index: number): string;
|
|
1104
1118
|
}
|
|
1105
1119
|
interface AnimationSettings{
|
|
@@ -1123,6 +1137,7 @@ interface AnimationSettings{
|
|
|
1123
1137
|
interface ActionSettings{
|
|
1124
1138
|
readonly Application: Application;
|
|
1125
1139
|
readonly Parent: object | any;
|
|
1140
|
+
readonly Count: number;
|
|
1126
1141
|
Item(Index: PpMouseActivation): ActionSetting;
|
|
1127
1142
|
}
|
|
1128
1143
|
interface ActionSetting{
|
|
@@ -1151,6 +1166,7 @@ interface PlaySettings{
|
|
|
1151
1166
|
interface TextRange{
|
|
1152
1167
|
readonly Application: Application;
|
|
1153
1168
|
readonly Parent: object | any;
|
|
1169
|
+
readonly Count: number;
|
|
1154
1170
|
readonly ActionSettings: ActionSettings;
|
|
1155
1171
|
readonly Start: number;
|
|
1156
1172
|
readonly Length: number;
|
|
@@ -1199,6 +1215,7 @@ interface Ruler{
|
|
|
1199
1215
|
interface RulerLevels{
|
|
1200
1216
|
readonly Application: Application;
|
|
1201
1217
|
readonly Parent: object | any;
|
|
1218
|
+
readonly Count: number;
|
|
1202
1219
|
Item(Index: number): RulerLevel;
|
|
1203
1220
|
}
|
|
1204
1221
|
interface RulerLevel{
|
|
@@ -1210,6 +1227,7 @@ interface RulerLevel{
|
|
|
1210
1227
|
interface TabStops{
|
|
1211
1228
|
readonly Application: Application;
|
|
1212
1229
|
readonly Parent: object | any;
|
|
1230
|
+
readonly Count: number;
|
|
1213
1231
|
Item(Index: number): TabStop;
|
|
1214
1232
|
DefaultSpacing: number;
|
|
1215
1233
|
Add(Type: PpTabStopType, Position: number): TabStop;
|
|
@@ -1278,6 +1296,7 @@ interface BulletFormat{
|
|
|
1278
1296
|
interface TextStyles{
|
|
1279
1297
|
readonly Application: Application;
|
|
1280
1298
|
readonly Parent: object | any;
|
|
1299
|
+
readonly Count: number;
|
|
1281
1300
|
Item(Type: PpTextStyleType): TextStyle;
|
|
1282
1301
|
}
|
|
1283
1302
|
interface TextStyle{
|
|
@@ -1290,6 +1309,7 @@ interface TextStyle{
|
|
|
1290
1309
|
interface TextStyleLevels{
|
|
1291
1310
|
readonly Application: Application;
|
|
1292
1311
|
readonly Parent: object | any;
|
|
1312
|
+
readonly Count: number;
|
|
1293
1313
|
Item(Level: number): TextStyleLevel;
|
|
1294
1314
|
}
|
|
1295
1315
|
interface TextStyleLevel{
|
|
@@ -1442,6 +1462,7 @@ interface Presentation{
|
|
|
1442
1462
|
interface Tags{
|
|
1443
1463
|
readonly Application: Application;
|
|
1444
1464
|
readonly Parent: object | any;
|
|
1465
|
+
readonly Count: number;
|
|
1445
1466
|
Item(Name: string): string;
|
|
1446
1467
|
Add(Name: string, Value: string): void;
|
|
1447
1468
|
Delete(Name: string): void;
|
|
@@ -1530,6 +1551,7 @@ interface Table{
|
|
|
1530
1551
|
interface Columns{
|
|
1531
1552
|
readonly Application: Application;
|
|
1532
1553
|
readonly Parent: object | any;
|
|
1554
|
+
readonly Count: number;
|
|
1533
1555
|
Item(Index: number): Column;
|
|
1534
1556
|
Add(BeforeColumn?: number): Column;
|
|
1535
1557
|
}
|
|
@@ -1544,6 +1566,7 @@ interface Column{
|
|
|
1544
1566
|
interface Rows{
|
|
1545
1567
|
readonly Application: Application;
|
|
1546
1568
|
readonly Parent: object | any;
|
|
1569
|
+
readonly Count: number;
|
|
1547
1570
|
Item(Index: number): Row;
|
|
1548
1571
|
Add(BeforeRow?: number): Row;
|
|
1549
1572
|
}
|
|
@@ -1558,6 +1581,7 @@ interface Row{
|
|
|
1558
1581
|
interface CellRange{
|
|
1559
1582
|
readonly Application: Application;
|
|
1560
1583
|
readonly Parent: object | any;
|
|
1584
|
+
readonly Count: number;
|
|
1561
1585
|
Item(Index: number): Cell;
|
|
1562
1586
|
readonly Borders: Borders;
|
|
1563
1587
|
}
|
|
@@ -1574,12 +1598,14 @@ interface Cell{
|
|
|
1574
1598
|
interface Borders{
|
|
1575
1599
|
readonly Application: Application;
|
|
1576
1600
|
readonly Parent: object | any;
|
|
1601
|
+
readonly Count: number;
|
|
1577
1602
|
Item(BorderType: PpBorderType): LineFormat;
|
|
1578
1603
|
}
|
|
1579
1604
|
interface Panes{
|
|
1580
1605
|
readonly Application: Application;
|
|
1581
1606
|
Item(Index: number): Pane;
|
|
1582
1607
|
readonly Parent: object | any;
|
|
1608
|
+
readonly Count: number;
|
|
1583
1609
|
}
|
|
1584
1610
|
interface Pane{
|
|
1585
1611
|
readonly Parent: object | any;
|
|
@@ -1627,6 +1653,7 @@ interface WebOptions{
|
|
|
1627
1653
|
interface PublishObjects{
|
|
1628
1654
|
readonly Application: Application;
|
|
1629
1655
|
readonly Parent: object | any;
|
|
1656
|
+
readonly Count: number;
|
|
1630
1657
|
Item(Index: number): PublishObject;
|
|
1631
1658
|
}
|
|
1632
1659
|
interface PublishObject{
|
|
@@ -1649,6 +1676,7 @@ interface PowerRex{
|
|
|
1649
1676
|
interface Comments{
|
|
1650
1677
|
readonly Application: Application;
|
|
1651
1678
|
readonly Parent: object | any;
|
|
1679
|
+
readonly Count: number;
|
|
1652
1680
|
Item(Index: number): Comment;
|
|
1653
1681
|
Add(Left: number, Top: number, Author: string, AuthorInitials: string, Text: string): Comment;
|
|
1654
1682
|
Add2(Left: number, Top: number, Author: string, AuthorInitials: string, Text: string, ProviderID: string, UserID: string): Comment;
|
|
@@ -1673,6 +1701,7 @@ interface Comment{
|
|
|
1673
1701
|
interface Designs{
|
|
1674
1702
|
readonly Application: Application;
|
|
1675
1703
|
readonly Parent: object | any;
|
|
1704
|
+
readonly Count: number;
|
|
1676
1705
|
Item(Index: any): Design;
|
|
1677
1706
|
Add(designName: string, Index?: number): Design;
|
|
1678
1707
|
Load(TemplateName: string, Index?: number): Design;
|
|
@@ -1751,12 +1780,14 @@ interface TimeLine{
|
|
|
1751
1780
|
interface Sequences{
|
|
1752
1781
|
readonly Application: Application;
|
|
1753
1782
|
readonly Parent: object | any;
|
|
1783
|
+
readonly Count: number;
|
|
1754
1784
|
Item(Index: number): Sequence;
|
|
1755
1785
|
Add(Index?: number): Sequence;
|
|
1756
1786
|
}
|
|
1757
1787
|
interface Sequence{
|
|
1758
1788
|
readonly Application: Application;
|
|
1759
1789
|
readonly Parent: object | any;
|
|
1790
|
+
readonly Count: number;
|
|
1760
1791
|
Item(Index: number): Effect;
|
|
1761
1792
|
AddEffect(Shape: Shape, effectId: MsoAnimEffect, Level?: MsoAnimateByLevel, trigger?: MsoAnimTriggerType, Index?: number): Effect;
|
|
1762
1793
|
Clone(Effect: Effect, Index?: number): Effect;
|
|
@@ -1835,6 +1866,7 @@ interface EffectInformation{
|
|
|
1835
1866
|
interface AnimationBehaviors{
|
|
1836
1867
|
readonly Application: Application;
|
|
1837
1868
|
readonly Parent: object | any;
|
|
1869
|
+
readonly Count: number;
|
|
1838
1870
|
Item(Index: number): AnimationBehavior;
|
|
1839
1871
|
Add(Type: MsoAnimType, Index?: number): AnimationBehavior;
|
|
1840
1872
|
}
|
|
@@ -1901,6 +1933,7 @@ interface PropertyEffect{
|
|
|
1901
1933
|
interface AnimationPoints{
|
|
1902
1934
|
readonly Application: Application;
|
|
1903
1935
|
readonly Parent: object | any;
|
|
1936
|
+
readonly Count: number;
|
|
1904
1937
|
Item(Index: number): AnimationPoint;
|
|
1905
1938
|
Add(Index?: number): AnimationPoint;
|
|
1906
1939
|
Smooth: MsoTriState;
|
|
@@ -1966,6 +1999,7 @@ interface SetEffect{
|
|
|
1966
1999
|
interface CustomLayouts{
|
|
1967
2000
|
readonly Application: Application;
|
|
1968
2001
|
readonly Parent: object | any;
|
|
2002
|
+
readonly Count: number;
|
|
1969
2003
|
Item(Index: any): CustomLayout;
|
|
1970
2004
|
Add(Index: number): CustomLayout;
|
|
1971
2005
|
Paste(Index?: number): CustomLayout;
|
|
@@ -2004,6 +2038,7 @@ interface TableStyle{
|
|
|
2004
2038
|
interface CustomerData{
|
|
2005
2039
|
readonly Application: Application;
|
|
2006
2040
|
readonly Parent: object | any;
|
|
2041
|
+
readonly Count: number;
|
|
2007
2042
|
Item(Id: string): CustomXMLPart;
|
|
2008
2043
|
Add(): CustomXMLPart;
|
|
2009
2044
|
Delete(Id: string): void;
|
|
@@ -2046,6 +2081,7 @@ interface TextFrame2{
|
|
|
2046
2081
|
NoTextRotation: MsoTriState;
|
|
2047
2082
|
}
|
|
2048
2083
|
interface FileConverters{
|
|
2084
|
+
readonly Count: number;
|
|
2049
2085
|
Item(Index: any): FileConverter;
|
|
2050
2086
|
}
|
|
2051
2087
|
interface FileConverter{
|
|
@@ -3080,6 +3116,7 @@ interface ResampleMediaTask{
|
|
|
3080
3116
|
readonly Shape: Shape;
|
|
3081
3117
|
}
|
|
3082
3118
|
interface ResampleMediaTasks{
|
|
3119
|
+
readonly Count: number;
|
|
3083
3120
|
Item(Index: number): ResampleMediaTask;
|
|
3084
3121
|
Pause(): void;
|
|
3085
3122
|
Cancel(): void;
|
|
@@ -3093,6 +3130,7 @@ interface MediaBookmark{
|
|
|
3093
3130
|
Delete(): void;
|
|
3094
3131
|
}
|
|
3095
3132
|
interface MediaBookmarks{
|
|
3133
|
+
readonly Count: number;
|
|
3096
3134
|
Item(Index: number): MediaBookmark;
|
|
3097
3135
|
Add(Position: number, Name: string): MediaBookmark;
|
|
3098
3136
|
}
|
|
@@ -3123,6 +3161,7 @@ interface Broadcast{
|
|
|
3123
3161
|
interface ProtectedViewWindows{
|
|
3124
3162
|
readonly Application: Application;
|
|
3125
3163
|
readonly Parent: object | any;
|
|
3164
|
+
readonly Count: number;
|
|
3126
3165
|
Item(Index: number): ProtectedViewWindow;
|
|
3127
3166
|
Open(FileName: string, ReadPassword?: string, OpenAndRepair?: MsoTriState): ProtectedViewWindow;
|
|
3128
3167
|
}
|
|
@@ -3173,6 +3212,7 @@ interface ThemeVariant{
|
|
|
3173
3212
|
interface ThemeVariants{
|
|
3174
3213
|
readonly Application: Application;
|
|
3175
3214
|
readonly Parent: object | any;
|
|
3215
|
+
readonly Count: number;
|
|
3176
3216
|
Item(Index: number): ThemeVariant;
|
|
3177
3217
|
}
|
|
3178
3218
|
interface Theme{
|
|
@@ -3188,6 +3228,7 @@ interface SlideNavigation{
|
|
|
3188
3228
|
interface Guides{
|
|
3189
3229
|
readonly Application: Application;
|
|
3190
3230
|
readonly Parent: object | any;
|
|
3231
|
+
readonly Count: number;
|
|
3191
3232
|
Item(Index: number): Guide;
|
|
3192
3233
|
Add(Orientation: PpGuideOrientation, Position: number): Guide;
|
|
3193
3234
|
}
|
package/dtstype/word.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
interface Application{
|
|
6
6
|
readonly Application: Application;
|
|
7
7
|
readonly Creator: number;
|
|
8
|
-
readonly Parent:
|
|
8
|
+
readonly Parent: Application;
|
|
9
9
|
readonly Name: string;
|
|
10
10
|
readonly Documents: Documents;
|
|
11
11
|
readonly Windows: Windows;
|
|
@@ -523,7 +523,6 @@ interface Document{
|
|
|
523
523
|
sblt(s: string): void;
|
|
524
524
|
ConvertVietDoc(CodePageOrigin: number): void;
|
|
525
525
|
PrintOut(Background?: any, Append?: any, Range?: any, OutputFileName?: any, From?: any, To?: any, Item?: any, Copies?: any, Pages?: any, PageType?: any, PrintToFile?: any, Collate?: any, ActivePrinterMacGX?: any, ManualDuplexPrint?: any, PrintZoomColumn?: any, PrintZoomRow?: any, PrintZoomPaperWidth?: any, PrintZoomPaperHeight?: any): void;
|
|
526
|
-
readonly MailEnvelope: MsoEnvelopeVB;
|
|
527
526
|
DisableFeatures: boolean;
|
|
528
527
|
DoNotEmbedSystemFonts: boolean;
|
|
529
528
|
readonly Signatures: SignatureSet;
|
|
@@ -6783,4 +6782,4 @@ interface Model3DFormat{
|
|
|
6783
6782
|
}
|
|
6784
6783
|
|
|
6785
6784
|
|
|
6786
|
-
declare const Application: Application & base.Application;
|
|
6785
|
+
declare const Application: Application & base.Application;
|
package/main.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{createRequire as
|
|
3
|
-
`,"utf8")}async function
|
|
4
|
-
"types": ${
|
|
5
|
-
`,"utf8")}async function
|
|
2
|
+
import{createRequire as je}from"module";import Q from"fs";import M from"path";import{fileURLToPath as Fe}from"url";import u from"fs";import d from"path";import z from"readline";import{spawn as V}from"child_process";import D from"fs";import ne from"path";import{spawn as _,spawnSync as re}from"child_process";var se={excel:"{00024505-0016-0000-C000-000000000046}",word:"{000209F5-0000-0000-C000-000000000046}",ppt:"{1CDC7D25-5AA3-4DC4-8E0C-91524280F806}",access:"{73A4C9C1-D68D-11D0-98BF-00A0C90DC8D9}"};function x(t){let e=String(t||"").trim().toLowerCase();if(e==="excel")return"excel";if(e==="word")return"word";if(e==="ppt"||e==="powerpoint")return"ppt";if(e==="access")return"access";throw new Error(`\u4E0D\u652F\u6301\u7684 appType: ${t||"(\u7A7A)"}\uFF0C\u4EC5\u652F\u6301 Excel/Word/Ppt/Access`)}async function S(t){let e=ne.join(t,"package.json");if(!D.existsSync(e))throw new Error(`\u672A\u627E\u5230 package.json: ${e}`);let o=await D.promises.readFile(e,"utf8"),n=JSON.parse(o);if(!n.appType)throw new Error("package.json \u7F3A\u5C11 appType \u5B57\u6BB5");return n}function ie(t){return t.replace(/%([^%]+)%/g,(e,o)=>process.env[o]||`%${o}%`)}function ae(t){let e=ie(t.trim());if(e.startsWith('"')){let n=e.indexOf('"',1);if(n>1)return e.slice(1,n)}let o=e.match(/^(.+?\.exe)/i);return o&&o[1]?o[1].trim():e}function ce(t){let e=re("reg",["query",t,"/ve"],{encoding:"utf8"});if(e.status!==0)return null;let n=`${e.stdout||""}`.split(/\r?\n/).find(s=>/REG_SZ|REG_EXPAND_SZ/i.test(s));if(!n)return null;let r=n.match(/REG_(?:SZ|EXPAND_SZ)\s+(.+)$/i);return!r||!r[1]?null:r[1].trim()}function P(t){let e=se[t],o=[`HKCR\\CLSID\\${e}\\LocalServer32`,`HKLM\\SOFTWARE\\Classes\\CLSID\\${e}\\LocalServer32`,`HKLM\\SOFTWARE\\WOW6432Node\\Classes\\CLSID\\${e}\\LocalServer32`];for(let n of o){let r=ce(n);if(!r)continue;let s=ae(r);if(s&&D.existsSync(s))return s}throw new Error(`\u65E0\u6CD5\u901A\u8FC7 CLSID \u5B9A\u4F4D ${t} \u5B89\u88C5\u8DEF\u5F84\uFF0C\u8BF7\u68C0\u67E5 Office \u662F\u5426\u5DF2\u5B89\u88C5`)}function W(t){try{return P(t),!0}catch{return!1}}function L(t){return String(t).padStart(2,"0")}function T(t,e=new Date){let o=String(t||"").trim(),n=L(e.getMonth()+1),r=L(e.getDate());return`uudev_pipe_${o}_${n}-${r}`}function pe(t){return/^[A-Za-z0-9_./:-]+$/.test(t)?t:`"${String(t).replace(/"/g,'""')}"`}function le(t){return t.replace(/\x1B\[[0-?]*[ -/]*[@-~]/g,"")}function E(t){let e=le(t).match(/https?:\/\/(?:127\.0\.0\.1|localhost):(\d+)/i)?.[1];if(!e)return null;let o=Number.parseInt(e,10);return!Number.isInteger(o)||o<=0||o>65535?null:o}function k(t){let e=t.pid;if(e){if(process.platform==="win32"){_("taskkill",["/pid",String(e),"/t","/f"],{stdio:"ignore",windowsHide:!0});return}t.kill("SIGTERM")}}function b(t,e,o){return new Promise((n,r)=>{let s=process.platform==="win32"?_("cmd.exe",["/d","/s","/c",[t,...e].map(pe).join(" ")],{cwd:o,stdio:"inherit"}):_(t,e,{cwd:o,stdio:"inherit"});s.on("error",i=>{r(i)}),s.on("close",i=>{if(i===0){n();return}r(new Error(`\u547D\u4EE4\u6267\u884C\u5931\u8D25: ${t} ${e.join(" ")}`))})})}import{fileURLToPath as ue}from"url";var fe=ue(import.meta.url),q=d.dirname(fe),A=[{key:"1",label:"Excel",value:"Excel",template:"office"},{key:"2",label:"Word",value:"Word",template:"office"},{key:"3",label:"Ppt",value:"Ppt",template:"office"},{key:"4",label:"Access",value:"Access",template:"office"}],B={Excel:"src_excel",Word:"src_word",Ppt:"src_ppt",Access:"src_acc"},me={Excel:["uudev/types/excel"],Word:["uudev/types/word"],Ppt:["uudev/types/ppt"],Access:["uudev/types/access"]};async function de(){try{return(await import("chalk")).default}catch{return null}}async function we(){try{return(await import("inquirer")).default}catch{return null}}function y(t){if(!t)return;let e=t.trim().toLowerCase(),o=A.find(r=>r.key===e);if(o)return o;let n=A.find(r=>r.label.toLowerCase()===e);if(n)return n}function ge(t){let e=y(t);return e?e.template:String(t||"office").toLowerCase()}function H(t){return/^\d+\.\d+\.\d+$/.test(String(t||""))}function j(t,e){return new Promise(o=>{t.question(e,n=>o(n.trim()))})}async function ye(t={}){let e={...t},o=await de(),n=await we();if(e.appType){let s=y(e.appType);s&&(e.appType=s.value)}if(e.name&&e.version&&e.appType)return e;let r=z.createInterface({input:process.stdin,output:process.stdout});try{if(!e.name){let s=await j(r,"\u8BF7\u8F93\u5165\u7A0B\u5E8F name: ");e.name=s}if(!e.version)for(;;){let i=await j(r,"\u8BF7\u8F93\u5165 version (\u9ED8\u8BA4 1.0.0): ")||"1.0.0";if(H(i)){e.version=i;break}let a="\u7248\u672C\u53F7\u683C\u5F0F\u9519\u8BEF\uFF0C\u4EC5\u652F\u6301 x.x.x\uFF0C\u4F8B\u5982 1.0.0\uFF0C\u8BF7\u91CD\u65B0\u8F93\u5165\u3002";console.log(o?o.red(a):a)}}finally{r.close()}if(!e.appType){let s=W("access"),i=s?A:A.filter(c=>c.value!=="Access"),a=i.map(c=>c.label).join("/");if(n){let c=await n.prompt([{type:"list",name:"appTypeSelection",message:"\u8BF7\u9009\u62E9 appType\uFF08\u4E0A\u4E0B\u65B9\u5411\u952E\u79FB\u52A8\uFF0C\u56DE\u8F66\u786E\u8BA4\uFF09",default:i[0].value,choices:i.map(m=>({name:m.label,value:m.value}))}]);e.appType=c.appTypeSelection}else{if(!s){let p=o?o.dim("\uFF08\u672A\u68C0\u6D4B\u5230 Access \u5B89\u88C5\uFF0C\u5DF2\u9690\u85CF\u8BE5\u9009\u9879\uFF09"):"\uFF08\u672A\u68C0\u6D4B\u5230 Access \u5B89\u88C5\uFF0C\u5DF2\u9690\u85CF\u8BE5\u9009\u9879\uFF09";console.log(p)}let c=o?o.cyan("\u8BF7\u9009\u62E9 appType:"):"\u8BF7\u9009\u62E9 appType:";console.log(c);for(let p of i){let f=o?`${o.green(p.key)}. ${o.yellow(p.label)}`:`${p.key}. ${p.label}`;console.log(f)}let m=z.createInterface({input:process.stdin,output:process.stdout});try{let p=await j(m,"\u8BF7\u8F93\u5165\u5E8F\u53F7\u6216\u540D\u79F0 (\u9ED8\u8BA4 1): "),f=y(p||"1");if(!f||f.value==="Access"&&!s)throw new Error(`appType \u4EC5\u652F\u6301 ${a}`);e.appType=f.value}finally{m.close()}}}return e}function ve(t){if(!t.name)throw new Error("name \u4E0D\u80FD\u4E3A\u7A7A");if(/[\\/]/.test(t.name))throw new Error("name \u4E0D\u80FD\u5305\u542B\u8DEF\u5F84\u5206\u9694\u7B26");if(!t.appType)throw new Error("appType \u4E0D\u80FD\u4E3A\u7A7A");if(!y(t.appType))throw new Error("appType \u4EC5\u652F\u6301 Excel/Word/Ppt/Access");if(!t.version)throw new Error("version \u4E0D\u80FD\u4E3A\u7A7A");if(!H(t.version))throw new Error("version \u4EC5\u652F\u6301 x.x.x \u683C\u5F0F\uFF0C\u4F8B\u5982 1.0.0")}async function $(t,e){let o=await u.promises.readdir(t,{withFileTypes:!0}),n=new Set(["node_modules","dist"]);await u.promises.mkdir(e,{recursive:!0});for(let r of o){if(r.isDirectory()&&n.has(r.name))continue;let s=d.join(t,r.name),i=d.join(e,r.name);r.isDirectory()?await $(s,i):await u.promises.copyFile(s,i)}}function he(t){let e=y(t);if(e)return B[e.value]}async function Pe(t,e,o){let n=he(o);if(!n)throw new Error(`\u672A\u627E\u5230 appType \u5BF9\u5E94\u6E90\u7801\u76EE\u5F55: ${o}`);let r=await u.promises.readdir(t,{withFileTypes:!0}),s=new Set(Object.values(B)),i=new Set(["node_modules","dist"]);await u.promises.mkdir(e,{recursive:!0});for(let c of r){if(!c.isDirectory()){let f=d.join(t,c.name),h=d.join(e,c.name);await u.promises.copyFile(f,h);continue}if(s.has(c.name)||i.has(c.name))continue;let m=d.join(t,c.name),p=d.join(e,c.name);await $(m,p)}let a=d.join(t,n);if(!u.existsSync(a))throw new Error(`\u6A21\u677F\u76EE\u5F55\u7F3A\u5C11 ${n}`);await $(a,d.join(e,"src"))}async function xe(t,e,o,n){let r=d.join(t,"package.json");if(!u.existsSync(r))return;let s=await u.promises.readFile(r,"utf8"),i=JSON.parse(s);i.name=e,i.version=o,i.appType=n,await u.promises.writeFile(r,`${JSON.stringify(i,null,2)}
|
|
3
|
+
`,"utf8")}async function Se(t,e){let o=d.join(t,"tsconfig.app.json");if(!u.existsSync(o))return;let n=y(e);if(!n)return;let r=me[n.value];if(!r)return;let s=await u.promises.readFile(o,"utf8"),i=JSON.stringify(r);if(/"types"\s*:\s*\[[\s\S]*?\]/.test(s)){let a=s.replace(/"types"\s*:\s*\[[\s\S]*?\]/,`"types": ${i}`);await u.promises.writeFile(o,a,"utf8");return}if(/"compilerOptions"\s*:\s*\{/.test(s)){let a=s.replace(/"compilerOptions"\s*:\s*\{/,`"compilerOptions": {
|
|
4
|
+
"types": ${i},`);await u.promises.writeFile(o,a,"utf8")}}async function Te(t){let e=d.join(t,"package-lock.json");u.existsSync(e)&&await u.promises.unlink(e)}function Ee(t){return new Promise((e,o)=>{let n=process.platform==="win32"?V("cmd.exe",["/d","/s","/c","npm.cmd install"],{cwd:t,stdio:"inherit"}):V("npm",["install"],{cwd:t,stdio:"inherit"});n.on("error",r=>{o(r)}),n.on("close",r=>{if(r===0){e();return}o(new Error(`npm install \u6267\u884C\u5931\u8D25\uFF0C\u9000\u51FA\u7801: ${r}`))})})}async function U(t){let e=await ye(t||{}),o=y(e.appType||"Excel");o&&(e.appType=o.value),e.version=e.version||"1.0.0",ve(e);let n=d.join(process.cwd(),e.name),r=ge(e.appType),i=[d.resolve(q,"..","apptemplate",r),d.resolve(q,"apptemplate",r)].find(a=>u.existsSync(a));if(!i)throw new Error(`\u672A\u627E\u5230 appType \u5BF9\u5E94\u6A21\u677F: ${e.appType}`);if(u.existsSync(n))throw new Error(`\u76EE\u5F55\u5DF2\u5B58\u5728: ${n}`);await u.promises.mkdir(n,{recursive:!0}),r==="office"?await Pe(i,n,e.appType):await $(i,n),await xe(n,e.name,e.version,e.appType),await Se(n,e.appType),await Te(n),console.log("\u6B63\u5728\u5B89\u88C5\u9879\u76EE\u4F9D\u8D56: npm install"),await Ee(n),console.log(`\u521B\u5EFA\u6210\u529F: ${n}`),console.log(`cd ${e.name}`)}import v from"fs";import C from"path";import ke from"archiver";async function be(t){let e=C.join(t,"package.json");if(!v.existsSync(e))throw new Error(`\u672A\u627E\u5230 package.json: ${e}`);let o=await v.promises.readFile(e,"utf8"),n=JSON.parse(o);if(!n.name)throw new Error("package.json \u7F3A\u5C11 name \u5B57\u6BB5");if(!n.version)throw new Error("package.json \u7F3A\u5C11 version \u5B57\u6BB5");return n}async function Ae(t,e,o){return new Promise((n,r)=>{let s=v.createWriteStream(e),i=ke("zip",{zlib:{level:9}});s.on("close",()=>n()),s.on("error",a=>r(a)),i.on("error",a=>r(a)),i.pipe(s),i.glob("**/*",{cwd:t,dot:!0,ignore:[o]}),i.finalize()})}async function $e(t,e){let o=C.join(t,"menifest.json");if(!v.existsSync(o))throw new Error(`\u672A\u627E\u5230 menifest.json: ${o}`);let n=await v.promises.readFile(o,"utf8"),r=JSON.parse(n);r.name=e.name,r.version=e.version,e.description&&(r.description=e.description,r.note=e.description),await v.promises.writeFile(o,`${JSON.stringify(r,null,2)}
|
|
5
|
+
`,"utf8")}async function Z(){let t=process.cwd(),e=await be(t),o=C.join(t,"dist"),n=`${e.name}_${e.version}.zip`,r=C.join(o,n),s=process.platform==="win32"?"npm.cmd":"npm";if(console.log("\u5F00\u59CB\u6267\u884C\u6784\u5EFA: npm run build"),await b(s,["run","build"],t),!v.existsSync(o))throw new Error("\u6784\u5EFA\u5B8C\u6210\u540E\u672A\u627E\u5230 dist \u76EE\u5F55");console.log("\u5F00\u59CB\u540C\u6B65 menifest.json \u5B57\u6BB5"),await $e(o,e),console.log(`\u5F00\u59CB\u6253\u5305 dist: ${n}`),await Ae(o,r,n),console.log(`\u53D1\u5E03\u5305\u751F\u6210\u6210\u529F: ${r}`)}import Ce from"net";import{spawn as F}from"child_process";function Oe(t){let e=["inherit","pipe","pipe"];return process.platform==="win32"?F("cmd.exe",["/c","npx","vite"],{cwd:t,stdio:e}):F("npx",["vite"],{cwd:t,stdio:e})}async function De(t,e=3e4){return new Promise((o,n)=>{let r=!1,s=l=>p(()=>n(l)),i=l=>{p(()=>n(new Error(`\u672A\u89E3\u6790\u5230\u672C\u5730\u670D\u52A1\u7AEF\u53E3\uFF0Cuudev debug\u5DF2\u9000\u51FA\uFF0C\u9000\u51FA\u7801: ${l}`)))},a=l=>f(l,process.stdout),c=l=>f(l,process.stderr),m=()=>{t.off("error",s),t.off("close",i),t.stdout?.off("data",a),t.stderr?.off("data",c)},p=l=>{r||(r=!0,clearTimeout(h),m(),l())},f=(l,g)=>{g.write(l);let w=E(l.toString("utf8"));w!==null&&p(()=>o(w))};t.on("error",s),t.on("close",i),t.stdout?.on("data",a),t.stderr?.on("data",c);let h=setTimeout(()=>{p(()=>n(new Error(`\u7B49\u5F85\u672C\u5730\u670D\u52A1\u7AEF\u53E3\u8D85\u65F6\uFF08${e}ms\uFF09`)))},e)})}async function N(t,e,o){let n=`\\\\.\\pipe\\${e}`,r=Ce.createServer(i=>{i.write(o,"utf8"),i.end()});await new Promise((i,a)=>{r.on("error",c=>{if(r.close(),c.code==="EADDRINUSE"){a(new Error(`\u53E6\u4E00\u4E2A uudev debug \u5B9E\u4F8B\u5DF2\u5728\u8FD0\u884C\uFF0C\u7BA1\u9053 ${e} \u88AB\u5360\u7528`));return}a(c)}),r.listen(n,i)});let s=F(t,{stdio:"ignore",windowsHide:!1});return s._pipeServer=r,s}function J(t){let e=t._pipeServer;e&&e.close()}async function G(){if(process.platform!=="win32")throw new Error("debug \u547D\u4EE4\u5F53\u524D\u4EC5\u652F\u6301 Windows");let t=process.cwd(),e=Oe(t);await new Promise((m,p)=>{e.once("error",f=>p(f)),e.once("spawn",()=>m())}),console.log("\u8C03\u8BD5\u670D\u52A1\u5DF2\u542F\u52A8\uFF0C\u6B63\u5728\u8BFB\u53D6 appType \u5E76\u542F\u52A8 Office...");let o=await S(t),n=x(o.appType),r=P(n),i=`http://127.0.0.1:${await De(e)}`,a=T(o.appType);console.log(`\u5DF2\u8BC6\u522B appType: ${o.appType}`),console.log(`\u542F\u52A8 Office: ${r}`);let c=await N(r,a,i);c.once("close",()=>{console.log("Office \u5BA2\u6237\u7AEF\u5DF2\u9000\u51FA\uFF0C\u6B63\u5728\u5173\u95ED uudev debug..."),J(c),k(e)}),await new Promise((m,p)=>{e.on("close",f=>{if(f===0||f===null){m();return}p(new Error(`uudev debug\u9000\u51FA\uFF0C\u9000\u51FA\u7801: ${f}`))})})}import K from"fs";import Y from"path";import{spawn as _e}from"child_process";async function X(){if(process.platform!=="win32")throw new Error("preview \u547D\u4EE4\u5F53\u524D\u4EC5\u652F\u6301 Windows");let t=process.cwd(),e=Y.join(t,"dist"),o=!1;if(K.existsSync(e)?(await K.promises.readdir(e)).length===0&&(o=!0):o=!0,o){let l=process.platform==="win32"?"npm.cmd":"npm";await b(l,["run","build"],t)}let n=Y.resolve(t),r=process.platform==="win32"?`npx.cmd vite preview --host=127.0.0.1 --outDir="${n}"`:`npx vite preview --host=127.0.0.1 --outDir="${n}"`,s=_e(r,{cwd:t,stdio:["ignore","pipe","pipe"],shell:!0}),i=await new Promise((l,g)=>{let w=!1,R=O=>{let oe=O.toString("utf8"),I=E(oe);I&&!w&&(w=!0,l(I))};s.stdout?.on("data",R),s.stderr?.on("data",R),s.on("error",g),s.on("close",O=>{w||g(new Error(`uudev preview \u9000\u51FA\uFF0C\u9000\u51FA\u7801: ${O}`))}),setTimeout(()=>{w||g(new Error("\u7B49\u5F85 uudev preview \u7AEF\u53E3\u8D85\u65F6"))},2e4)}),a=await S(t),c=x(a.appType),m=P(c),p=`http://127.0.0.1:${i}/dist/index.html`,f=T(a.appType),h=await N(m,f,p);h.once("close",()=>{console.log("Office \u5BA2\u6237\u7AEF\u5DF2\u9000\u51FA\uFF0C\u6B63\u5728\u5173\u95ED uudev preview..."),J(h),k(s)}),await new Promise((l,g)=>{s.on("close",w=>{w===0||w===null?l(void 0):g(new Error(`uudev preview\u9000\u51FA\uFF0C\u9000\u51FA\u7801: ${w}`))})})}var St=je(import.meta.url);function Ne(){let t=M.dirname(Fe(import.meta.url)),e=[M.resolve(t,"package.json"),M.resolve(t,"../package.json")];for(let o of e)if(Q.existsSync(o))try{let n=JSON.parse(Q.readFileSync(o,"utf8"));if(n?.version)return n.version}catch{}return"0.0.0"}var te=Ne();async function Je(){try{return(await import("chalk")).default}catch{return null}}function ee(){console.log(`uudev v${te}`),console.log(""),console.log("uudev <command> [options]"),console.log(""),console.log("Commands:"),console.log(" create"),console.log(" \u521B\u5EFAuuapp\u9879\u76EE, \u4F1A\u8FDB\u5165\u4EA4\u4E92\u5F0F\u5411\u5BFC\uFF0C\u5E2E\u52A9\u4F60\u5B8C\u6210\u9879\u76EE\u521B\u5EFA"),console.log(" debug"),console.log(" \u5728\u9879\u76EE\u4E2D\u6267\u884C npm run debug\uFF0Cuudev\u4F1A\u81EA\u52A8\u542F\u52A8\u5BF9\u5E94\u7684office\u5BA2\u6237\u7AEF\uFF0C\u7136\u540E\u5C31\u53EF\u4EE5\u8C03\u8BD5\u4F60\u7684\u5DE5\u7A0B"),console.log(" preview"),console.log(" \u6784\u5EFA\u5E76 vite preview \u9879\u76EE\uFF0C\u5728\u53D1\u5E03\u4F60\u7684\u9879\u76EE\u524D\uFF0C\u53EF\u4EE5\u5148\u672C\u5730\u9884\u89C8\u8FDB\u884C\u53D1\u5E03\u524D\u7684\u6D4B\u8BD5"),console.log(" makezip"),console.log(" \u5728\u9879\u76EE\u4E2D\u6267\u884C npm run makezip\uFF0Cuudev\u4F1A\u5C06dist\u76EE\u5F55\u5185\u5BB9\u6253\u5305\u4E3AappName_version.zip, \u7136\u540E\u4F60\u53EF\u4EE5\u767B\u5F55uuapp\u7F51\u7AD9\uFF0C\u628A\u8FD9\u4E2Azip\u4E0A\u4F20\u5230uuapp\u670D\u52A1\u5668"),console.log(" --help, -h"),console.log(" \u663E\u793A\u5E2E\u52A9\u4FE1\u606F"),console.log(" --version, -v"),console.log(" \u663E\u793A\u7248\u672C\u4FE1\u606F"),console.log(""),console.log("AppType options: Excel | Word | Ppt | Access"),console.log("Version format : x.x.x (\u4F8B\u5982 1.0.0)")}function Me(){console.log(`uudev v${te}`)}async function Re(){let t=process.argv[2],e=await Je();if(!t||t==="--help"||t==="-h"||t==="help"){ee();return}if(t==="--version"||t==="-v"||t==="version"){Me();return}if(t==="create"){if(process.argv.length>3){let o="create \u547D\u4EE4\u4F1A\u5FFD\u7565\u9644\u5E26\u53C2\u6570\uFF0C\u5DF2\u8FDB\u5165\u521B\u5EFA\u5411\u5BFC\u3002";console.log(e?e.yellow(o):o)}await U();return}if(t==="makezip"){await Z();return}if(t==="debug"){await G();return}if(t==="preview"){await X();return}ee()}Re().catch(t=>{console.error(`\u6267\u884C\u5931\u8D25: ${t.message}`),process.exit(1)});
|