halfnelson / nativescript-source-to-jsx-def

Walk nativescript source to generate JSX types for `svelte-type-checker-vscode`
Other
4 stars 1 forks source link

Missing attributes for FormattedString and Span #4

Closed shirakaba closed 4 years ago

shirakaba commented 4 years ago

They can be found here:

import { Span } from "tns-core-modules/text/span";
import { FormattedString } from "tns-core-modules/text/formatted-string";
shirakaba commented 4 years ago

I'd expect the following lines to be added:

type FontStyle = import("@nativescript/core/ui/styling/font").FontStyle;
type FontWeight = import("@nativescript/core/ui/styling/font").FontWeight;
type ObservableArray<T> = import("@nativescript/core/data/observable-array").ObservableArray<T>;
type Span = import("@nativescript/core/text/span").Span;
type TextDecoration = import("@nativescript/core/ui/text-base").TextDecoration;

// ui/text-base/formatted-string.d.ts
export type FormattedStringAttributes = ViewBaseAttributes & {
    backgroundColor: Color;
    color: Color;
    fontFamily: string;
    fontSize: number;
    fontStyle: FontStyle;
    fontWeight: FontWeight;
    spans: ObservableArray<Span>;
    textDecoration: TextDecoration;
};

// ui/text-base/span.d.ts
export type SpanAttributes = ViewBaseAttributes & {
    backgroundColor: Color;
    color: Color;
    fontFamily: string;
    fontSize: number;
    fontStyle: FontStyle;
    fontWeight: FontWeight;
    text: string;
    textDecoration: TextDecoration;
};
halfnelson commented 4 years ago

this is in now