Skip to content

Commit

Permalink
feat: update
Browse files Browse the repository at this point in the history
  • Loading branch information
qq15725 committed Dec 2, 2024
1 parent 95a6a24 commit 840a2a1
Show file tree
Hide file tree
Showing 18 changed files with 217 additions and 11 deletions.
8 changes: 8 additions & 0 deletions src/openxml/drawing/EffectList.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { _Namespace } from './_Namespace'

/**
* @link https://learn.microsoft.com/dotnet/api/documentformat.openxml.drawing.effectlist
*/
export class EffectList extends _Namespace {
readonly tag = 'effectLst'
}
16 changes: 16 additions & 0 deletions src/openxml/drawing/EffectReference.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { defineChild } from '../../core'
import { _Namespace } from './_Namespace'

/**
* @link https://learn.microsoft.com/dotnet/api/documentformat.openxml.drawing.effectreference
*/
export class EffectReference extends _Namespace {
readonly tag = 'effectRef'

@defineChild('hslClr', _Namespace) hslClr?: _Namespace
@defineChild('prstClr', _Namespace) prstClr?: _Namespace
@defineChild('schemeClr', _Namespace) schemeClr?: _Namespace
@defineChild('scrgbClr', _Namespace) scrgbClr?: _Namespace
@defineChild('srgbClr', _Namespace) srgbClr?: _Namespace
@defineChild('sysClr', _Namespace) sysClr?: _Namespace
}
16 changes: 16 additions & 0 deletions src/openxml/drawing/FillReference.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { defineChild } from '../../core'
import { _Namespace } from './_Namespace'

/**
* @link https://learn.microsoft.com/dotnet/api/documentformat.openxml.drawing.fillreference
*/
export class FillReference extends _Namespace {
readonly tag = 'fillRef'

@defineChild('hslClr', _Namespace) hslClr?: _Namespace
@defineChild('prstClr', _Namespace) prstClr?: _Namespace
@defineChild('schemeClr', _Namespace) schemeClr?: _Namespace
@defineChild('scrgbClr', _Namespace) scrgbClr?: _Namespace
@defineChild('srgbClr', _Namespace) srgbClr?: _Namespace
@defineChild('sysClr', _Namespace) sysClr?: _Namespace
}
16 changes: 16 additions & 0 deletions src/openxml/drawing/FontReference.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { defineChild } from '../../core'
import { _Namespace } from './_Namespace'

/**
* @link https://learn.microsoft.com/dotnet/api/documentformat.openxml.drawing.fontreference
*/
export class FontReference extends _Namespace {
readonly tag = 'fontRef'

@defineChild('hslClr', _Namespace) hslClr?: _Namespace
@defineChild('prstClr', _Namespace) prstClr?: _Namespace
@defineChild('schemeClr', _Namespace) schemeClr?: _Namespace
@defineChild('scrgbClr', _Namespace) scrgbClr?: _Namespace
@defineChild('srgbClr', _Namespace) srgbClr?: _Namespace
@defineChild('sysClr', _Namespace) sysClr?: _Namespace
}
14 changes: 14 additions & 0 deletions src/openxml/drawing/GradientFill.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { defineChild } from '../../core'
import { _Namespace } from './_Namespace'

/**
* https://learn.microsoft.com/dotnet/api/documentformat.openxml.drawing.gradientfill
*/
export class GradientFill extends _Namespace {
readonly tag = 'gradFill'

@defineChild('a:gsLst', _Namespace) gsLst?: _Namespace
@defineChild('a:lin', _Namespace) lin?: _Namespace
@defineChild('a:path', _Namespace) path?: _Namespace
@defineChild('a:tileRect', _Namespace) tileRect?: _Namespace
}
16 changes: 16 additions & 0 deletions src/openxml/drawing/LineReference.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { defineChild } from '../../core'
import { _Namespace } from './_Namespace'

/**
* @link https://learn.microsoft.com/dotnet/api/documentformat.openxml.drawing.linereference
*/
export class LineReference extends _Namespace {
readonly tag = 'lnRef'

@defineChild('hslClr', _Namespace) hslClr?: _Namespace
@defineChild('prstClr', _Namespace) prstClr?: _Namespace
@defineChild('schemeClr', _Namespace) schemeClr?: _Namespace
@defineChild('scrgbClr', _Namespace) scrgbClr?: _Namespace
@defineChild('srgbClr', _Namespace) srgbClr?: _Namespace
@defineChild('sysClr', _Namespace) sysClr?: _Namespace
}
8 changes: 8 additions & 0 deletions src/openxml/drawing/NoFill.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { _Namespace } from './_Namespace'

/**
* https://learn.microsoft.com/dotnet/api/documentformat.openxml.drawing.nofill
*/
export class NoFill extends _Namespace {
readonly tag = 'noFill'
}
8 changes: 8 additions & 0 deletions src/openxml/drawing/Outline.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { _Namespace } from './_Namespace'

/**
* https://learn.microsoft.com/dotnet/api/documentformat.openxml.drawing.outline
*/
export class Outline extends _Namespace {
readonly tag = 'ln'
}
12 changes: 12 additions & 0 deletions src/openxml/drawing/PatternFill.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { defineChild } from '../../core'
import { _Namespace } from './_Namespace'

/**
* https://learn.microsoft.com/dotnet/api/documentformat.openxml.drawing.patternfill
*/
export class PatternFill extends _Namespace {
readonly tag = 'pattFill'

@defineChild('a:bgClr', _Namespace) bgClr?: _Namespace
@defineChild('a:fgClr', _Namespace) fgClr?: _Namespace
}
11 changes: 11 additions & 0 deletions src/openxml/drawing/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
export * from './Blip'
export * from './BodyProperties'
export * from './CustomGeometry'
export * from './EffectList'
export * from './EffectReference'
export * from './Extents'
export * from './FillReference'
export * from './FontReference'
export * from './GradientFill'
export * from './LineReference'
export * from './ListStyle'
export * from './MasterColorMapping'
export * from './NoFill'
export * from './Offset'
export * from './Outline'
export * from './Paragraph'
export * from './ParagraphProperties'
export * from './PatternFill'
export * from './PresetGeometry'
export * from './Run'
export * from './RunProperties'
export * from './SolidFill'
Expand Down
13 changes: 10 additions & 3 deletions src/openxml/presentation/BackgroundProperties.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
import { defineChild } from '../../core'
import { EffectList, GradientFill, NoFill, PatternFill, SolidFill } from '../drawing'
import { _Namespace } from './_Namespace'
import { BlipFill } from './BlipFill'

/**
* https://learn.microsoft.com/dotnet/api/documentformat.openxml.presentation.backgroundproperties
*/
export class BackgroundProperties extends _Namespace {
readonly tag = 'bgPr'

@defineChild('p:blipFill', BlipFill) declare blipFill: BlipFill
// TODO
@defineChild('a:blipFill', _Namespace) declare blipFill: _Namespace
@defineChild('a:effectDag', _Namespace) declare effectDag: _Namespace
@defineChild('a:effectLst', EffectList) declare effectLst: EffectList
@defineChild('a:extLst', _Namespace) declare extLst: _Namespace
@defineChild('a:gradFill', GradientFill) declare gradFill: GradientFill
@defineChild('a:grpFill', _Namespace) declare grpFill: _Namespace
@defineChild('a:noFill', NoFill) declare noFill: NoFill
@defineChild('a:pattFill', PatternFill) declare pattFill: PatternFill
@defineChild('a:solidFill', SolidFill) declare solidFill: SolidFill
}
2 changes: 1 addition & 1 deletion src/openxml/presentation/GroupShape.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { GroupShapeProperties } from './GroupShapeProperties'
import { NonVisualGroupShapeProperties } from './NonVisualGroupShapeProperties'

/**
* https://learn.microsoft.com/dotnet/api/documentformat.openxml.presentation.nonvisualdrawingproperties
* https://learn.microsoft.com/dotnet/api/documentformat.openxml.presentation.groupshape
*/
export class GroupShape extends _Namespace {
readonly tag = 'grpSp'
Expand Down
12 changes: 11 additions & 1 deletion src/openxml/presentation/GroupShapeProperties.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defineChild } from '../../core'
import { Transform2D } from '../drawing'
import { EffectList, GradientFill, NoFill, PatternFill, SolidFill, Transform2D } from '../drawing'
import { _Namespace } from './_Namespace'

/**
Expand All @@ -8,5 +8,15 @@ import { _Namespace } from './_Namespace'
export class GroupShapeProperties extends _Namespace {
readonly tag = 'grpSpPr'

@defineChild('a:blipFill', _Namespace) declare blipFill: _Namespace
@defineChild('a:effectDag', _Namespace) declare effectDag: _Namespace
@defineChild('a:effectLst', EffectList) declare effectLst: EffectList
@defineChild('a:extLst', _Namespace) declare extLst: _Namespace
@defineChild('a:gradFill', GradientFill) declare gradFill: GradientFill
@defineChild('a:grpFill', _Namespace) declare grpFill: _Namespace
@defineChild('a:noFill', NoFill) declare noFill: NoFill
@defineChild('a:pattFill', PatternFill) declare pattFill: PatternFill
@defineChild('a:scene3d', _Namespace) declare scene3d: _Namespace
@defineChild('a:solidFill', SolidFill) declare solidFill: SolidFill
@defineChild('a:xfrm', Transform2D) declare xfrm: Transform2D
}
4 changes: 3 additions & 1 deletion src/openxml/presentation/Picture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,18 @@ import { _Namespace } from './_Namespace'
import { BlipFill } from './BlipFill'
import { NonVisualPictureProperties } from './NonVisualPictureProperties'
import { ShapeProperties } from './ShapeProperties'
import { ShapeStyle } from './ShapeStyle'

/**
* https://learn.microsoft.com/dotnet/api/documentformat.openxml.presentation.picture
*/
export class Picture extends _Namespace {
readonly tag = 'pic'

@defineChild('p:nvPicPr', NonVisualPictureProperties) declare nvPicPr: NonVisualPictureProperties
@defineChild('p:blipFill', BlipFill) declare blipFill: BlipFill
@defineChild('p:nvPicPr', NonVisualPictureProperties) declare nvPicPr: NonVisualPictureProperties
@defineChild('p:spPr', ShapeProperties) declare spPr: ShapeProperties
@defineChild('p:style', ShapeStyle) declare style: ShapeStyle

get id(): string { return this.nvPicPr.cNvPr.id }
get name(): string { return this.nvPicPr.cNvPr.name }
Expand Down
2 changes: 2 additions & 0 deletions src/openxml/presentation/Shape.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { defineChild } from '../../core'
import { _Namespace } from './_Namespace'
import { NonVisualShapeProperties } from './NonVisualShapeProperties'
import { ShapeProperties } from './ShapeProperties'
import { ShapeStyle } from './ShapeStyle'
import { TextBody } from './TextBody'

/**
Expand All @@ -15,6 +16,7 @@ export class Shape extends _Namespace {
@defineChild('p:nvSpPr', NonVisualShapeProperties) declare nvSpPr: NonVisualShapeProperties
@defineChild('p:spPr', ShapeProperties) declare spPr: ShapeProperties
@defineChild('p:txBody', TextBody) declare txBody: TextBody
@defineChild('p:style', ShapeStyle) declare style: ShapeStyle

get id(): string { return this.nvSpPr.cNvPr.id }
get name(): string { return this.nvSpPr.cNvPr.name }
Expand Down
29 changes: 24 additions & 5 deletions src/openxml/presentation/ShapeProperties.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
import { defineChild } from '../../core'
import { SolidFill, Transform2D } from '../drawing'
import { CustomGeometry } from '../drawing/CustomGeometry'
import { PresetGeometry } from '../drawing/PresetGeometry'
import {
CustomGeometry,
EffectList,
GradientFill,
NoFill,
Outline,
PatternFill,
PresetGeometry,
SolidFill,
Transform2D,
} from '../drawing'
import { _Namespace } from './_Namespace'

/**
Expand All @@ -10,8 +18,19 @@ import { _Namespace } from './_Namespace'
export class ShapeProperties extends _Namespace {
readonly tag = 'spPr'

@defineChild('a:blipFill', _Namespace) blipFill?: _Namespace
@defineChild('a:custGeom', CustomGeometry) custGeom?: CustomGeometry
@defineChild('a:effectDag', _Namespace) effectDag?: _Namespace
@defineChild('a:effectLst', EffectList) effectLst?: EffectList
@defineChild('a:extLst', _Namespace) extLst?: _Namespace
@defineChild('a:gradFill', GradientFill) gradFill?: GradientFill
@defineChild('a:grpFill', _Namespace) grpFill?: _Namespace
@defineChild('a:ln', Outline) ln?: Outline
@defineChild('a:noFill', NoFill) noFill?: NoFill
@defineChild('a:pattFill', PatternFill) pattFill?: PatternFill
@defineChild('a:prstGeom', PresetGeometry) prstGeom?: PresetGeometry
@defineChild('a:scene3d', _Namespace) scene3d?: _Namespace
@defineChild('a:solidFill', SolidFill) solidFill?: SolidFill
@defineChild('a:sp3d', _Namespace) sp3d?: _Namespace
@defineChild('a:xfrm', Transform2D) declare xfrm: Transform2D
@defineChild('a:prstGeom', PresetGeometry) prstGeom?: PresetGeometry
@defineChild('a:custGeom', CustomGeometry) custGeom?: CustomGeometry
}
15 changes: 15 additions & 0 deletions src/openxml/presentation/ShapeStyle.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { defineChild } from '../../core'
import { EffectReference, FillReference, FontReference, LineReference } from '../drawing'
import { _Namespace } from './_Namespace'

/**
* https://learn.microsoft.com/dotnet/api/documentformat.openxml.presentation.shapestyle
*/
export class ShapeStyle extends _Namespace {
readonly tag = 'style'

@defineChild('a:lnRef', LineReference) lnRef?: LineReference
@defineChild('a:fillRef', FillReference) fillRef?: FillReference
@defineChild('a:effectRef', EffectReference) effectRef?: EffectReference
@defineChild('a:fontRef', FontReference) fontRef?: FontReference
}
26 changes: 26 additions & 0 deletions src/openxml/presentation/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,34 @@
export * from './ApplicationNonVisualDrawingProperties'
export * from './Background'
export * from './BackgroundProperties'
export * from './BlipFill'
export * from './ColorMap'
export * from './ColorMapOverride'
export * from './CommonSlideData'
export * from './DefaultTextStyle'
export * from './GroupShape'
export * from './GroupShapeProperties'
export * from './NonVisualDrawingProperties'
export * from './NonVisualGroupShapeProperties'
export * from './NonVisualPictureDrawingProperties'
export * from './NonVisualPictureProperties'
export * from './NonVisualShapeDrawingProperties'
export * from './NonVisualShapeProperties'
export * from './NotesSize'
export * from './Picture'
export * from './PlaceholderShape'
export * from './Presentation'
export * from './PresentationProperties'
export * from './Shape'
export * from './ShapeProperties'
export * from './Slide'
export * from './SlideId'
export * from './SlideIdList'
export * from './SlideLayout'
export * from './SlideMaster'
export * from './SlideMasterId'
export * from './SlideMasterIdList'
export * from './SlideSize'
export * from './TextBody'
export * from './Timing'
export * from './ViewProperties'

0 comments on commit 840a2a1

Please sign in to comment.