Skip to content

Commit

Permalink
faet: update
Browse files Browse the repository at this point in the history
  • Loading branch information
qq15725 committed Dec 4, 2024
1 parent ba95fb3 commit 602b8a2
Show file tree
Hide file tree
Showing 26 changed files with 227 additions and 74 deletions.
10 changes: 10 additions & 0 deletions src/openxml/drawing/BackgroundColor.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { defineElement } from '../../core'
import { _ColorDefinable } from './_ColorDefinable'

/**
* https://learn.microsoft.com/dotnet/api/documentformat.openxml.drawing.backgroundcolor
*/
@defineElement('a:bgClr')
export class BackgroundColor extends _ColorDefinable {
//
}
12 changes: 9 additions & 3 deletions src/openxml/drawing/CustomGeometry.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
import { defineElement, OXML } from '../../core'
import type { Rectangle } from './Rectangle'
import { defineChild, defineElement, OXML } from '../../core'

/**
* https://learn.microsoft.com/dotnet/api/documentformat.openxml.presentation.customgeometry
* https://learn.microsoft.com/dotnet/api/documentformat.openxml.drawing.customgeometry
*/
@defineElement('a:custGeom')
export class CustomGeometry extends OXML {
//
@defineChild('a:ahLst') declare ahLst: OXML
@defineChild('a:avLst') declare avLst: OXML
@defineChild('a:cxnLst') declare cxnLst: OXML
@defineChild('a:gdLst') declare gdLst: OXML
@defineChild('a:pathLst') declare pathLst: OXML
@defineChild('a:rect') declare rect: Rectangle
}
12 changes: 4 additions & 8 deletions src/openxml/drawing/EffectReference.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
import { defineChild, defineElement, OXML } from '../../core'
import { defineAttribute, defineElement } from '../../core'
import { _ColorDefinable } from './_ColorDefinable'

/**
* @link https://learn.microsoft.com/dotnet/api/documentformat.openxml.drawing.effectreference
*/
@defineElement('a:effectRef')
export class EffectReference extends OXML {
@defineChild('hslClr') hslClr?: OXML
@defineChild('prstClr') prstClr?: OXML
@defineChild('schemeClr') schemeClr?: OXML
@defineChild('scrgbClr') scrgbClr?: OXML
@defineChild('srgbClr') srgbClr?: OXML
@defineChild('sysClr') sysClr?: OXML
export class EffectReference extends _ColorDefinable {
@defineAttribute('idx') declare idx: string
}
12 changes: 4 additions & 8 deletions src/openxml/drawing/FillReference.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
import { defineChild, defineElement, OXML } from '../../core'
import { defineAttribute, defineElement } from '../../core'
import { _ColorDefinable } from './_ColorDefinable'

/**
* @link https://learn.microsoft.com/dotnet/api/documentformat.openxml.drawing.fillreference
*/
@defineElement('a:fillRef')
export class FillReference extends OXML {
@defineChild('a:hslClr', OXML) hslClr?: OXML
@defineChild('a:prstClr', OXML) prstClr?: OXML
@defineChild('a:schemeClr', OXML) schemeClr?: OXML
@defineChild('a:scrgbClr', OXML) scrgbClr?: OXML
@defineChild('a:srgbClr', OXML) srgbClr?: OXML
@defineChild('a:sysClr', OXML) sysClr?: OXML
export class FillReference extends _ColorDefinable {
@defineAttribute('idx') declare idx: string
}
12 changes: 4 additions & 8 deletions src/openxml/drawing/FontReference.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
import { defineChild, defineElement, OXML } from '../../core'
import { defineAttribute, defineElement } from '../../core'
import { _ColorDefinable } from './_ColorDefinable'

/**
* @link https://learn.microsoft.com/dotnet/api/documentformat.openxml.drawing.fontreference
*/
@defineElement('a:fontRef')
export class FontReference extends OXML {
@defineChild('a:hslClr') hslClr?: OXML
@defineChild('a:prstClr') prstClr?: OXML
@defineChild('a:schemeClr') schemeClr?: OXML
@defineChild('a:scrgbClr') scrgbClr?: OXML
@defineChild('a:srgbClr') srgbClr?: OXML
@defineChild('a:sysClr') sysClr?: OXML
export class FontReference extends _ColorDefinable {
@defineAttribute('idx') declare idx: string
}
20 changes: 20 additions & 0 deletions src/openxml/drawing/ForegroundColor.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import type { HslColor } from './HslColor'
import type { PresetColor } from './PresetColor'
import type { RgbColorModelHex } from './RgbColorModelHex'
import type { RgbColorModelPercentage } from './RgbColorModelPercentage'
import type { SchemeColor } from './SchemeColor'
import type { SystemColor } from './SystemColor'
import { defineChild, defineElement, OXML } from '../../core'

/**
* https://learn.microsoft.com/dotnet/api/documentformat.openxml.drawing.foregroundcolor
*/
@defineElement('a:fgClr')
export class ForegroundColor extends OXML {
@defineChild('a:hslClr') hslClr?: HslColor
@defineChild('a:prstClr') prstClr?: PresetColor
@defineChild('a:schemeClr') schemeClr?: SchemeColor
@defineChild('a:scrgbClr') scrgbClr?: RgbColorModelPercentage
@defineChild('a:srgbClr') srgbClr?: RgbColorModelHex
@defineChild('a:sysClr') sysClr?: SystemColor
}
12 changes: 8 additions & 4 deletions src/openxml/drawing/GradientFill.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
import type { GradientStopList } from './GradientStopList'
import type { LinearGradientFill } from './LinearGradientFill'
import type { Path } from './Path'
import type { TileRectangle } from './TileRectangle'
import { defineChild, defineElement, OXML } from '../../core'

/**
* https://learn.microsoft.com/dotnet/api/documentformat.openxml.drawing.gradientfill
*/
@defineElement('a:gradFill')
export class GradientFill extends OXML {
@defineChild('a:gsLst', OXML) gsLst?: OXML
@defineChild('a:lin', OXML) lin?: OXML
@defineChild('a:path', OXML) path?: OXML
@defineChild('a:tileRect', OXML) tileRect?: OXML
@defineChild('a:gsLst') gsLst?: GradientStopList
@defineChild('a:lin') lin?: LinearGradientFill
@defineChild('a:path') path?: Path
@defineChild('a:tileRect') tileRect?: TileRectangle
}
10 changes: 10 additions & 0 deletions src/openxml/drawing/GradientStop.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { defineAttribute, defineElement } from '../../core'
import { _ColorDefinable } from './_ColorDefinable'

/**
* https://learn.microsoft.com/dotnet/api/documentformat.openxml.drawing.GradientStop
*/
@defineElement('a:gs')
export class GradientStop extends _ColorDefinable {
@defineAttribute('pos', 'positiveFixedPercentage') declare pos: number
}
10 changes: 10 additions & 0 deletions src/openxml/drawing/GradientStopList.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import type { GradientStop } from './GradientStop'
import { defineChildren, defineElement, OXML } from '../../core'

/**
* https://learn.microsoft.com/dotnet/api/documentformat.openxml.drawing.gradientstoplist
*/
@defineElement('a:gsLst')
export class GradientStopList extends OXML {
@defineChildren('a:gs') declare value: GradientStop[]
}
11 changes: 11 additions & 0 deletions src/openxml/drawing/HslColor.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { defineAttribute, defineElement, OXML } from '../../core'

/**
* https://learn.microsoft.com/dotnet/api/documentformat.openxml.drawing.hslcolor
*/
@defineElement('a:hslClr')
export class HslColor extends OXML {
@defineAttribute('hue', 'positiveFixedAngle') declare hue: number
@defineAttribute('sat', 'percentage') declare sat: number
@defineAttribute('lum', 'percentage') declare lum: number
}
12 changes: 4 additions & 8 deletions src/openxml/drawing/LineReference.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
import { defineChild, defineElement, OXML } from '../../core'
import { defineAttribute, defineElement } from '../../core'
import { _ColorDefinable } from './_ColorDefinable'

/**
* @link https://learn.microsoft.com/dotnet/api/documentformat.openxml.drawing.linereference
*/
@defineElement('a:lnRef')
export class LineReference extends OXML {
@defineChild('a:hslClr', OXML) hslClr?: OXML
@defineChild('a:prstClr', OXML) prstClr?: OXML
@defineChild('a:schemeClr', OXML) schemeClr?: OXML
@defineChild('a:scrgbClr', OXML) scrgbClr?: OXML
@defineChild('a:srgbClr', OXML) srgbClr?: OXML
@defineChild('a:sysClr', OXML) sysClr?: OXML
export class LineReference extends _ColorDefinable {
@defineAttribute('idx') declare idx: string
}
10 changes: 10 additions & 0 deletions src/openxml/drawing/LinearGradientFill.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { defineAttribute, defineElement, OXML } from '../../core'

/**
* https://learn.microsoft.com/dotnet/api/documentformat.openxml.drawing.gradientfill
*/
@defineElement('a:lin')
export class LinearGradientFill extends OXML {
@defineAttribute('ang', 'positiveFixedAngle') declare ang: number
@defineAttribute('scaled', 'boolean') declare scaled: number
}
9 changes: 9 additions & 0 deletions src/openxml/drawing/Path.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { defineElement, OXML } from '../../core'

/**
* https://learn.microsoft.com/dotnet/api/documentformat.openxml.drawing.path
*/
@defineElement('a:path')
export class Path extends OXML {
//
}
10 changes: 7 additions & 3 deletions src/openxml/drawing/PatternFill.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import { defineChild, defineElement, OXML } from '../../core'
import type { BackgroundColor } from './BackgroundColor'
import type { ForegroundColor } from './ForegroundColor'
import { defineAttribute, defineChild, defineElement, OXML } from '../../core'

/**
* https://learn.microsoft.com/dotnet/api/documentformat.openxml.drawing.patternfill
*/
@defineElement('a:pattFill')
export class PatternFill extends OXML {
@defineChild('a:bgClr', OXML) bgClr?: OXML
@defineChild('a:fgClr', OXML) fgClr?: OXML
@defineAttribute('prst', 'presetPatternVal') prst?: string

@defineChild('a:bgClr') bgClr?: BackgroundColor
@defineChild('a:fgClr') fgClr?: ForegroundColor
}
9 changes: 9 additions & 0 deletions src/openxml/drawing/PresetColor.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { defineAttribute, defineElement, OXML } from '../../core'

/**
* https://learn.microsoft.com/dotnet/api/documentformat.openxml.drawing.presetcolor
*/
@defineElement('a:prstClr')
export class PresetColor extends OXML {
@defineAttribute('val') declare val: string
}
12 changes: 12 additions & 0 deletions src/openxml/drawing/Rectangle.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { defineAttribute, defineElement, OXML } from '../../core'

/**
* https://learn.microsoft.com/dotnet/api/documentformat.openxml.drawing.rectangle
*/
@defineElement('a:rect')
export class Rectangle extends OXML {
@defineAttribute('b', 'adjCoordinate') declare b: number
@defineAttribute('l', 'adjCoordinate') declare l: number
@defineAttribute('r', 'adjCoordinate') declare r: number
@defineAttribute('t', 'adjCoordinate') declare t: number
}
9 changes: 9 additions & 0 deletions src/openxml/drawing/RgbColorModelHex.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { defineAttribute, defineElement, OXML } from '../../core'

/**
* https://learn.microsoft.com/dotnet/api/documentformat.openxml.drawing.rgbcolormodelhex
*/
@defineElement('a:srgbClr')
export class RgbColorModelHex extends OXML {
@defineAttribute('val') declare val: string
}
11 changes: 11 additions & 0 deletions src/openxml/drawing/RgbColorModelPercentage.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { defineAttribute, defineElement, OXML } from '../../core'

/**
* https://learn.microsoft.com/dotnet/api/documentformat.openxml.drawing.rgbcolormodelpercentage
*/
@defineElement('a:scrgbClr')
export class RgbColorModelPercentage extends OXML {
@defineAttribute('r', 'percentage') declare r: number
@defineAttribute('g', 'percentage') declare g: number
@defineAttribute('b', 'percentage') declare b: number
}
2 changes: 1 addition & 1 deletion src/openxml/drawing/RunProperties.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ export class RunProperties extends OXML {
@defineChild('ea') ea?: OXML
@defineChild('latin') latin?: OXML
@defineChild('sym') sym?: OXML
@defineChild('solidFill') solidFill?: SolidFill
@defineChild('a:solidFill') solidFill?: SolidFill
}
10 changes: 4 additions & 6 deletions src/openxml/drawing/SolidFill.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import type { SchemeColor } from './SchemeColor'
import type { SrgbClr } from './SrgbClr'
import { defineChild, defineElement, OXML } from '../../core'
import { defineElement } from '../../core'
import { _ColorDefinable } from './_ColorDefinable'

/**
* https://learn.microsoft.com/dotnet/api/documentformat.openxml.drawing.solidfill
*/
@defineElement('a:solidFill')
export class SolidFill extends OXML {
@defineChild('a:srgbClr') srgbClr?: SrgbClr
@defineChild('a:schemeClr') schemeClr?: SchemeColor
export class SolidFill extends _ColorDefinable {
//
}
12 changes: 0 additions & 12 deletions src/openxml/drawing/SrgbClr.ts

This file was deleted.

9 changes: 9 additions & 0 deletions src/openxml/drawing/SystemColor.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { defineAttribute, defineElement, OXML } from '../../core'

/**
* https://learn.microsoft.com/dotnet/api/documentformat.openxml.drawing.systemcolor
*/
@defineElement('a:sysClr')
export class SystemColor extends OXML {
@defineAttribute('val') declare val: string
}
12 changes: 12 additions & 0 deletions src/openxml/drawing/TileRectangle.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { defineAttribute, defineElement, OXML } from '../../core'

/**
* https://learn.microsoft.com/dotnet/api/documentformat.openxml.drawing.transform2d
*/
@defineElement('a:tileRect')
export class TileRectangle extends OXML {
@defineAttribute('b', 'percentage') declare b: number
@defineAttribute('l', 'percentage') declare l: number
@defineAttribute('t', 'percentage') declare t: number
@defineAttribute('r', 'percentage') declare r: number
}
16 changes: 16 additions & 0 deletions src/openxml/drawing/_ColorDefinable.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import type { HslColor } from './HslColor'
import type { PresetColor } from './PresetColor'
import type { RgbColorModelHex } from './RgbColorModelHex'
import type { RgbColorModelPercentage } from './RgbColorModelPercentage'
import type { SchemeColor } from './SchemeColor'
import type { SystemColor } from './SystemColor'
import { defineChild, OXML } from '../../core'

export class _ColorDefinable extends OXML {
@defineChild('a:hslClr') hslClr?: HslColor
@defineChild('a:prstClr') prstClr?: PresetColor
@defineChild('a:schemeClr') schemeClr?: SchemeColor
@defineChild('a:scrgbClr') scrgbClr?: RgbColorModelPercentage
@defineChild('a:srgbClr') srgbClr?: RgbColorModelHex
@defineChild('a:sysClr') sysClr?: SystemColor
}
13 changes: 12 additions & 1 deletion src/openxml/drawing/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export * from './AudioFromFile'
export * from './BackgroundColor'
export * from './Blip'
export * from './BlipFill'
export * from './BodyProperties'
Expand All @@ -12,7 +13,12 @@ export * from './ExtensionList'
export * from './Extents'
export * from './FillReference'
export * from './FontReference'
export * from './ForegroundColor'
export * from './GradientFill'
export * from './GradientStop'
export * from './GradientStopList'
export * from './HslColor'
export * from './LinearGradientFill'
export * from './LineReference'
export * from './ListStyle'
export * from './MasterColorMapping'
Expand All @@ -21,19 +27,24 @@ export * from './Offset'
export * from './Outline'
export * from './Paragraph'
export * from './ParagraphProperties'
export * from './Path'
export * from './PatternFill'
export * from './PresetColor'
export * from './PresetGeometry'
export * from './Rectangle'
export * from './RgbColorModelHex'
export * from './Run'
export * from './RunProperties'
export * from './SolidFill'
export * from './SourceRectangle'
export * from './SrgbClr'
export * from './Stretch'
export * from './SystemColor'
export * from './Text'
export * from './TextAlignmentTypeValues'
export * from './TextAnchoringTypeValues'
export * from './TextWrappingValues'
export * from './Theme'
export * from './Tile'
export * from './TileRectangle'
export * from './Transform2D'
export * from './VideoFromFile'
Loading

0 comments on commit 602b8a2

Please sign in to comment.