Inline single use interfaces

This commit is contained in:
Dolan
2021-03-15 00:11:39 +00:00
parent 18ce200cdb
commit a3febae8a3
42 changed files with 91 additions and 181 deletions

View File

@ -1,12 +1,10 @@
import { XmlAttributeComponent } from "file/xml-components";
export interface IDocPropertiesAttributes {
export class DocPropertiesAttributes extends XmlAttributeComponent<{
readonly id?: number;
readonly name?: string;
readonly descr?: string;
}
export class DocPropertiesAttributes extends XmlAttributeComponent<IDocPropertiesAttributes> {
}> {
protected readonly xmlKeys = {
id: "id",
name: "name",

View File

@ -1,13 +1,11 @@
import { XmlAttributeComponent } from "file/xml-components";
export interface IEffectExtentAttributes {
export class EffectExtentAttributes extends XmlAttributeComponent<{
readonly b?: number;
readonly l?: number;
readonly r?: number;
readonly t?: number;
}
export class EffectExtentAttributes extends XmlAttributeComponent<IEffectExtentAttributes> {
}> {
protected readonly xmlKeys = {
b: "b",
l: "l",

View File

@ -1,11 +1,9 @@
import { XmlAttributeComponent } from "file/xml-components";
export interface IExtentAttributes {
export class ExtentAttributes extends XmlAttributeComponent<{
readonly cx?: number;
readonly cy?: number;
}
export class ExtentAttributes extends XmlAttributeComponent<IExtentAttributes> {
}> {
protected readonly xmlKeys = {
cx: "cx",
cy: "cy",

View File

@ -4,11 +4,9 @@ import { Align } from "./align";
import { HorizontalPositionRelativeFrom, IHorizontalPositionOptions } from "./floating-position";
import { PositionOffset } from "./position-offset";
interface IHorizontalPositionAttributes {
class HorizontalPositionAttributes extends XmlAttributeComponent<{
readonly relativeFrom: HorizontalPositionRelativeFrom;
}
class HorizontalPositionAttributes extends XmlAttributeComponent<IHorizontalPositionAttributes> {
}> {
protected readonly xmlKeys = {
relativeFrom: "relativeFrom",
};

View File

@ -1,12 +1,10 @@
// http://officeopenxml.com/drwPicFloating-position.php
import { XmlAttributeComponent, XmlComponent } from "file/xml-components";
interface ISimplePosAttributes {
class SimplePosAttributes extends XmlAttributeComponent<{
readonly x: number;
readonly y: number;
}
class SimplePosAttributes extends XmlAttributeComponent<ISimplePosAttributes> {
}> {
protected readonly xmlKeys = {
x: "x",
y: "y",

View File

@ -4,11 +4,9 @@ import { Align } from "./align";
import { IVerticalPositionOptions, VerticalPositionRelativeFrom } from "./floating-position";
import { PositionOffset } from "./position-offset";
interface IVerticalPositionAttributes {
class VerticalPositionAttributes extends XmlAttributeComponent<{
readonly relativeFrom: VerticalPositionRelativeFrom;
}
class VerticalPositionAttributes extends XmlAttributeComponent<IVerticalPositionAttributes> {
}> {
protected readonly xmlKeys = {
relativeFrom: "relativeFrom",
};

View File

@ -1,11 +1,9 @@
import { XmlAttributeComponent } from "file/xml-components";
export interface IGraphicFrameLockAttributes {
export class GraphicFrameLockAttributes extends XmlAttributeComponent<{
readonly xmlns?: string;
readonly noChangeAspect?: number;
}
export class GraphicFrameLockAttributes extends XmlAttributeComponent<IGraphicFrameLockAttributes> {
}> {
protected readonly xmlKeys = {
xmlns: "xmlns:a",
noChangeAspect: "noChangeAspect",

View File

@ -1,10 +1,8 @@
import { XmlAttributeComponent } from "file/xml-components";
export interface IGraphicDataAttributes {
export class GraphicDataAttributes extends XmlAttributeComponent<{
readonly uri?: string;
}
export class GraphicDataAttributes extends XmlAttributeComponent<IGraphicDataAttributes> {
}> {
protected readonly xmlKeys = {
uri: "uri",
};

View File

@ -1,12 +1,10 @@
import { IMediaData } from "file/media";
import { XmlAttributeComponent, XmlComponent } from "file/xml-components";
interface IBlipProperties {
class BlipAttributes extends XmlAttributeComponent<{
readonly embed: string;
readonly cstate: string;
}
class BlipAttributes extends XmlAttributeComponent<IBlipProperties> {
}> {
protected readonly xmlKeys = {
embed: "r:embed",
cstate: "cstate",

View File

@ -1,11 +1,9 @@
import { XmlAttributeComponent } from "file/xml-components";
export interface IPicLocksAttributes {
export class PicLocksAttributes extends XmlAttributeComponent<{
readonly noChangeAspect?: number;
readonly noChangeArrowheads?: number;
}
export class PicLocksAttributes extends XmlAttributeComponent<IPicLocksAttributes> {
}> {
protected readonly xmlKeys = {
noChangeAspect: "noChangeAspect",
noChangeArrowheads: "noChangeArrowheads",

View File

@ -1,12 +1,10 @@
import { XmlAttributeComponent } from "file/xml-components";
export interface INonVisualPropertiesAttributes {
export class NonVisualPropertiesAttributes extends XmlAttributeComponent<{
readonly id?: number;
readonly name?: string;
readonly descr?: string;
}
export class NonVisualPropertiesAttributes extends XmlAttributeComponent<INonVisualPropertiesAttributes> {
}> {
protected readonly xmlKeys = {
id: "id",
name: "name",

View File

@ -1,10 +1,8 @@
import { XmlAttributeComponent } from "file/xml-components";
export interface IPicAttributes {
export class PicAttributes extends XmlAttributeComponent<{
readonly xmlns?: string;
}
export class PicAttributes extends XmlAttributeComponent<IPicAttributes> {
}> {
protected readonly xmlKeys = {
xmlns: "xmlns:pic",
};

View File

@ -1,11 +1,9 @@
import { XmlAttributeComponent } from "file/xml-components";
export interface IExtentsAttributes {
export class ExtentsAttributes extends XmlAttributeComponent<{
readonly cx?: number;
readonly cy?: number;
}
export class ExtentsAttributes extends XmlAttributeComponent<IExtentsAttributes> {
}> {
protected readonly xmlKeys = {
cx: "cx",
cy: "cy",

View File

@ -1,11 +1,9 @@
import { XmlAttributeComponent } from "file/xml-components";
export interface IOffsetAttributes {
export class OffsetAttributes extends XmlAttributeComponent<{
readonly x?: number;
readonly y?: number;
}
export class OffsetAttributes extends XmlAttributeComponent<IOffsetAttributes> {
}> {
protected readonly xmlKeys = {
x: "x",
y: "y",

View File

@ -1,10 +1,8 @@
import { XmlAttributeComponent } from "file/xml-components";
export interface IPresetGeometryAttributes {
export class PresetGeometryAttributes extends XmlAttributeComponent<{
readonly prst?: string;
}
export class PresetGeometryAttributes extends XmlAttributeComponent<IPresetGeometryAttributes> {
}> {
protected readonly xmlKeys = {
prst: "prst",
};

View File

@ -1,10 +1,8 @@
import { XmlAttributeComponent } from "file/xml-components";
export interface IShapePropertiesAttributes {
export class ShapePropertiesAttributes extends XmlAttributeComponent<{
readonly bwMode?: string;
}
export class ShapePropertiesAttributes extends XmlAttributeComponent<IShapePropertiesAttributes> {
}> {
protected readonly xmlKeys = {
bwMode: "bwMode",
};

View File

@ -3,11 +3,9 @@ import { XmlAttributeComponent, XmlComponent } from "file/xml-components";
import { GraphicData } from "./graphic-data";
interface IGraphicProperties {
class GraphicAttributes extends XmlAttributeComponent<{
readonly a: string;
}
class GraphicAttributes extends XmlAttributeComponent<IGraphicProperties> {
}> {
protected readonly xmlKeys = {
a: "xmlns:a",
};

View File

@ -2,14 +2,7 @@ import { XmlAttributeComponent } from "file/xml-components";
import { IDistance } from "../drawing";
// distT, distB etc have no effect on inline images, only floating
export interface IInlineAttributes extends IDistance {
readonly distT?: number;
readonly distB?: number;
readonly distL?: number;
readonly distR?: number;
}
export class InlineAttributes extends XmlAttributeComponent<IInlineAttributes> {
export class InlineAttributes extends XmlAttributeComponent<IDistance> {
protected readonly xmlKeys = {
distT: "distT",
distB: "distB",

View File

@ -6,10 +6,6 @@ import { IMargins } from "../floating";
interface IWrapSquareAttributes extends IDistance {
readonly wrapText?: TextWrappingSide;
readonly distT?: number;
readonly distB?: number;
readonly distL?: number;
readonly distR?: number;
}
class WrapSquareAttributes extends XmlAttributeComponent<IWrapSquareAttributes> {

View File

@ -3,12 +3,10 @@ import { XmlAttributeComponent, XmlComponent } from "file/xml-components";
import { IMargins } from "../floating";
interface IWrapTightAttributes {
class WrapTightAttributes extends XmlAttributeComponent<{
readonly distT?: number;
readonly distB?: number;
}
class WrapTightAttributes extends XmlAttributeComponent<IWrapTightAttributes> {
}> {
protected readonly xmlKeys = {
distT: "distT",
distB: "distB",

View File

@ -3,12 +3,10 @@ import { XmlAttributeComponent, XmlComponent } from "file/xml-components";
import { IMargins } from "../floating";
interface IWrapTopAndBottomAttributes {
class WrapTopAndBottomAttributes extends XmlAttributeComponent<{
readonly distT?: number;
readonly distB?: number;
}
class WrapTopAndBottomAttributes extends XmlAttributeComponent<IWrapTopAndBottomAttributes> {
}> {
protected readonly xmlKeys = {
distT: "distT",
distB: "distB",