You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found this library useful and wrote up a TypeScript declaration for it. Would you like to include it in this library?
// TODO how does CSSProperties compare to CSSStyleDeclaration from typescript's lib.dom.d.ts?import{CSSProperties}from'typestyle/lib/types';interfaceNonNestedPlainObject{// TODO should this include null and/or undefined?[key: string]: string|number|boolean;}exportinterfaceSvgTextOpts{text: string;// TODO the definition for document.getElementById incorrectly says it only returns HTMLElement,// but 'element' below should really be just SVGElement. The union with HTMLElement is a kludge.element?: SVGElement|HTMLElement;// 'svg' below should really be just SVGSVGElement. See comment above.svg?: SVGSVGElement|HTMLElement;x?: number;// default: 0y?: number;// default: 0width?: number;// default: 'auto'height?: number;// default: 'auto'maxWidth?: number;// default: 'auto'maxHeight?: number;// default: 'auto'outerWidth?: number;// default: 'auto'outerHeight?: number;// default: 'auto'maxLines?: number;// default: Infinityalign?: 'left'|'center'|'right';// default: 'left'verticalAlign?: 'top'|'middle'|'bottom';// default: 'top'textOverflow: 'ellipsis'|'clip'|string;selectorNamespace?: string;className?: string;style?: CSSProperties;styleElement?: HTMLStyleElement;// default: first style elementattrs?: NonNestedPlainObject;// TODO what should the type be?rect?: NonNestedPlainObject;padding?: number|string;margin?: number|string;}exportdefaultclassSvgText{svg: SVGSVGElement;style: HTMLStyleElement;constructor(svgTextOpts: SvgTextOpts)writeStyle(selector: string,css: CSSProperties,style: HTMLStyleElement)forIllustrator(textWeb: SVGTextElement,textAi: SVGTextElement,postScriptFontName: string)}exportinterfaceSvgUtil{toJs(prop: string): keyofCSSProperties;toCss(prop: keyofCSSProperties): string;// TODO neither lib.dom.ts nor typestyle types have the CSS formatted properties, e.g.,// {"vertical-align": 'baseline' | 'sub' | ...},// but that's what NonNestedPlainObject should actually be here.normalizeKeys(object: CSSProperties|NonNestedPlainObject,style: 'css'|'js'): NonNestedPlainObject|CSSProperties;// style default: 'css'// TODO this should actually be something like "keyof SVGElementTagNameMap", but that doesn't exist in lib.dom.d.tscreateElement<KextendskeyofElementTagNameMap>(name: K,attrs: NonNestedPlainObject): ElementTagNameMap[K]&SVGElement;isPosNum(value: any): boolean;minNum(...params: any[]): number|'auto';maxNum(...params: any[]): number|'auto';autoNum(value: string|number,altNum: number): number;toArrayLen4(value: number|undefined|null|string): [number,number,number,number];}
The text was updated successfully, but these errors were encountered:
Hello,
I found this library useful and wrote up a TypeScript declaration for it. Would you like to include it in this library?
The text was updated successfully, but these errors were encountered: