How to use the vue-tsx-support.ofType function in vue-tsx-support

To help you get started, we’ve selected a few vue-tsx-support examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github wonderful-panda / vue-tsx-support / test / tsc / basic / extend.tsx View on Github external
function by_convert() {
    const Base = vuetsx.ofType().convert(Vue.extend({}));

    /* add more attributes */
    const Extend = vuetsx.ofType().extendFrom(Base);
    // OK
     console.log(s) } />;
    // NG
    ;   //// TS2322 | TS2326 | TS2769: 'bar' is missing
    // NG
    ;   //// TS2322 | TS2326 | TS2769: 'foo' is missing

    const WithNativeOn = vuetsx.withNativeOn(Base);
    ;

    const WithHtmlAttrs = vuetsx.withHtmlAttrs(Base);
    ;
github wonderful-panda / vue-tsx-support / test / tsc / basic / extend.tsx View on Github external
function by_convert() {
    const Base = vuetsx.ofType().convert(Vue.extend({}));

    /* add more attributes */
    const Extend = vuetsx.ofType().extendFrom(Base);
    // OK
     console.log(s) } />;
    // NG
    ;   //// TS2322 | TS2326 | TS2769: 'bar' is missing
    // NG
    ;   //// TS2322 | TS2326 | TS2769: 'foo' is missing

    const WithNativeOn = vuetsx.withNativeOn(Base);
    ;

    const WithHtmlAttrs = vuetsx.withHtmlAttrs(Base);
    ;

    const WithUnknownProps = vuetsx.withUnknownProps(Base);
    ;
}
github wonderful-panda / vue-tsx-support / test / tsc / basic / extend.tsx View on Github external
function by_class() {
    class Base extends vuetsx.Component {
        someProp: string = "foo";
        someMethod() {
        }
    }

    /* add more attributes */
    const Extend = vuetsx.ofType().extendFrom(Base);
    // OK
     console.log(s) } />;
    // NG
    ;   //// TS2322 | TS2326 | TS2769: 'bar' is missing
    // NG
    ;   //// TS2322 | TS2326 | TS2769: 'foo' is missing

    // Extend inherits prototype of Base.
    const ext = new Extend();
    console.log(ext.someProp, ext.someMethod());

    const WithNativeOn = vuetsx.withNativeOn(Base);
    ;
    console.log(new WithNativeOn().someProp);

    const WithHtmlAttrs = vuetsx.withHtmlAttrs(Base);
github wonderful-panda / vue-tsx-support / test / tsc / basic / extend.tsx View on Github external
function by_createComponent() {
    const Base = vuetsx.createComponent({});

    // NG
    ;   //// TS2322 | TS2326 | TS2769: 'foo' is missing
    // OK
    ;
    // NG
    ;   //// TS2322 | TS2339 | TS2769: Property 'bar' does not exist
    // NG
    ;   //// TS2322 | TS2339 | TS2769: Property 'onErr' does not exist

    /* add more attributes */
    const Extend = vuetsx.ofType().extendFrom(Base);
    // OK
     console.log(s) } />;
    // NG
    ;   //// TS2322 | TS2326 | TS2769: 'bar' is missing
    // NG
    ;   //// TS2322 | TS2326 | TS2769: 'foo' is missing

    const WithNativeOn = vuetsx.withNativeOn(Base);
    ;

    const WithHtmlAttrs = vuetsx.withHtmlAttrs(Base);
    ;

    const WithUnknownProps = vuetsx.withUnknownProps(Base);
    ;
}
github wonderful-panda / vue-tsx-support / test / tsc / basic / extend.tsx View on Github external
const Base = vuetsx.componentFactoryOf().create({
        props: {
            foo: String
        },
        computed: {
            someProp(): string {
                return "";
            }
        },
        methods: {
            someMethod() {}
        }
    }, ["foo"]);

    /* add more attributes */
    const Extend = vuetsx.ofType().extendFrom(Base);
    // OK
     console.log(s) } />;
    // NG
    ;   //// TS2322 | TS2326 | TS2769: 'bar' is missing
    // NG
    ;   //// TS2322 | TS2326 | TS2769: 'foo' is missing

    // Extend inherits prototype of Base.
    const ext = new Extend();
    console.log(ext.someProp, ext.someMethod());

    const WithNativeOn = vuetsx.withNativeOn(Base);
    ;
    console.log(new WithNativeOn().someProp);

    const WithHtmlAttrs = vuetsx.withHtmlAttrs(Base);
github snowyu / qinputex / src / components / quasar / QPopupProxy.ts View on Github external
interface ScopedSlots {
  default: any;
}

interface Events {
    // all memebers must be prefixed by 'on'
    onShow: (evt: any) => void;
    onHide: (evt: any) => void;
    // If event handler has only one parameter, you can specify parameter type as a shorthand.
    // For example, this is equivalent to `onError: (arg: { code: number, detail: string }) => void`
    onInput: { value: any };
    onBeforeShow: {evt: Event};
    onBeforeHide: {evt: Event};
}

export const QPopupProxy = tsx.ofType().convert(Comp);
github snowyu / qinputex / src / components / quasar / QBtn.ts View on Github external
default: any;
  loading: any;
}

interface Events {
    // all memebers must be prefixed by 'on'
    onShow: (evt: any) => void;
    onHide: (evt: any) => void;
    // If event handler has only one parameter, you can specify parameter type as a shorthand.
    // For example, this is equivalent to `onError: (arg: { code: number, detail: string }) => void`
    onInput: { value: any };
    onBeforeShow: {evt: Event};
    onBeforeHide: {evt: Event};
}

export const QBtn = tsx.ofType().convert(Comp);
github snowyu / qinputex / src / components / quasar / QToolbar.ts View on Github external
interface ScopedSlots {
  default: any;
}

interface Events {
    // all memebers must be prefixed by 'on'
    onShow: (evt: any) => void;
    onHide: (evt: any) => void;
    // If event handler has only one parameter, you can specify parameter type as a shorthand.
    // For example, this is equivalent to `onError: (arg: { code: number, detail: string }) => void`
    onInput: { value: any };
    onBeforeShow: {evt: Event};
    onBeforeHide: {evt: Event};
}

export const QToolbar = tsx.ofType().convert(Comp);

export const QToolbarTitle = tsx.ofType().convert(Title);
github snowyu / qinputex / src / components / quasar / QCard.ts View on Github external
bordered?: boolean;
}

interface SectionProps {
  align?: 'left' | 'center' | 'right' | 'between' | 'around';
  vertical?: boolean;
}

interface ScopedSlots {
  default: any;
}

interface Events {
}

export const QCard = tsx.ofType().convert(Comp);

export const QCardSection = tsx.ofType().convert(CompSection);