Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions packages/msotype/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,14 @@ export interface AlternativeProperties<TLength = GlobalsString | 0> {
}

export interface StandardProperties<TLength = GlobalsString | 0> {
/**
* Sets or retrieves the interpolation (resampling) method used to stretch an `<img /> element
*
* | Inherited | &vert; | Initial |
* | --------- | -- | ------------- |
* `false` | &vert; |`n/a` |
*/
msInterpolationMode?: MsInterpolationModeProperty;
/**
* | Inherited | &vert; | Initial |
* | --------- | -- | ------------- |
Expand Down Expand Up @@ -3350,6 +3358,14 @@ export interface AlternativePropertiesHyphen<TLength = GlobalsString | 0> {
}

export interface StandardPropertiesHyphen<TLength = GlobalsString | 0> {
/**
* Sets or retrieves the interpolation (resampling) method used to stretch an `<img /> element
*
* | Inherited | &vert; | Initial |
* | --------- | -- | ------------- |
* `false` | &vert; |`n/a` |
*/
'ms-interpolation-mode'?: MsInterpolationModeProperty;
/**
* | Inherited | &vert; | Initial |
* | --------- | -- | ------------- |
Expand Down Expand Up @@ -5970,6 +5986,8 @@ type GlobalsString = string & {};

type GlobalsNumber = number & {};

export type MsInterpolationModeProperty = 'bicubic' | 'nearest-neighbor';

export type MsoAnsiFontSizeProperty<TLength = GlobalsString | 0> = FontSize | TLength | GlobalsString;

export type MsoAnsiFontStyleProperty = 'italic' | 'normal' | 'oblique';
Expand Down
13 changes: 13 additions & 0 deletions packages/scripts/src/mso/patches/ms.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { MSOProperties } from '@email-types/data/mso';

export const msPatches: MSOProperties = {
'ms-interpolation-mode': {
syntax: 'nearest-neighbor | bicubic',
description:
'Sets or retrieves the interpolation (resampling) method used to stretch an `<img /> element',
initial: null,
inherited: false,
shorthand: false,
features: [],
},
};
12 changes: 8 additions & 4 deletions packages/scripts/src/mso/properties.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
/* eslint-disable import/no-mutable-exports */
import { properties as rawProperties } from '@email-types/data/mso';
import { toPascalCase } from '../utils';
import { parse, AnyDataType } from './parser';
import { createComment } from './comment';
import { Category, DataType } from './constants';
import { parse, AnyDataType } from './parser';
import { msPatches } from './patches/ms';
import { toPascalCase } from '../utils';

export interface Property {
key: string;
Expand All @@ -16,10 +17,13 @@ export interface Property {
}

export let getProperties = (): Property[] => {
const entries = Object.entries(rawProperties).sort();
const entries = Object.entries({
...rawProperties,
...msPatches,
}).sort();

const properties = entries.map(([key, value]) => {
const types = parse(value.syntax);

const property: Property = {
key,
types,
Expand Down