Code Monkey home page Code Monkey logo

ts-type-hidden's Introduction

TS Type Hidden

Hide those familiar type codes! Get the snippet back to its simplest form!

English | 简体中文

example

Features

  • One-click hide/show type code
  • Customize the type kinds that need to be hidden (interface, type-alias, ...)
  • Type code will be displayed when cursor active the line
  • There are small blue dots that means relative line exist hidden type code
  • Under hidden mode, Multi-line type code will be folded into one line
  • Status bar shows the current hidden mode status, click to toggle

Commands

  • ts-type-hidden.toggle: Toggle the current hidden mode

    • Default keyboard shortcuts:
      • mac: cmd + shift + t
      • windows: ctrl + shift + t
  • ts-type-hidden.open: Open the hidden mode

  • ts-type-hidden.close: Close the hidden mode

Settings

  • ts-type-hidden.enable: Enable the plugin or not

  • ts-type-hidden.typeIconPath: The path to the Icon file next to a line of type code(support svg/png/jpg/jpeg/... file format)

  • ts-type-hidden.ignoreTypeKinds: Type kinds that do not need to be hidden👇

    View example
    6469_1692709788_raw.mp4
    View configuration options
    • type-alias:

      type A  = ({ ... } & { ... }) | string[]

      ⏭️ type A = ({ ... } & { ... }) | string[]

    • interface:

      interface A { ... }

      ⏭️ interface A { ... }

    • function-overload:

      function fn(a: number): number[];
      function fn(a: number[], opts: { ... }): number[];

      ⏭️ function fn(a: number): number[];

      ⏭️ function fn(a: number[], opts: { ... }): number[];

    • function-return:

      function fn(): number {}

      ⏭️ : number

    • function-type-predicate:

      function fn(a: any): a is number {}

      ⏭️ : a is number

    • function-parameter:

      function fn<A extends string>(a: A, b: number) {}

      ⏭️ : A

      ⏭️ : number

    • function-generic-definition:

      function fn<A extends string, B = [A, '']>() {}

      ⏭️ <A extends string, B = [A, '']>

    • function-call-generic:

      const name = get<UserModule>(userModule, 'info.name');
      const userModel = new UserModel<UserEntity>({ ... });

      ⏭️ <UserModule>

      ⏭️ <UserEntity>

    • tsx-component-generic:

      const EditUserForm = <ProForm<UserModel> id={userId} />;

      ⏭️ <UserModel>

    • variable-type-definition:

      const a: number = 1;

      ⏭️ : number

    • class-property-type-definition:

      class A {
        public size?: number;
        private setSize!: Function = () => {}
      }

      ⏭️ ?: number

      ⏭️ !: Function

    • angle-brackets-assertion:

      const num: any = 77;
      const num1 = (<number>num).toFixed(2);

      ⏭️ <number>

    • as-assertion:

      fn() as any;

      ⏭️ as any

    • satisfies-operator:

      const user = { ... } satisfies UserModel;

      ⏭️ satisfies UserModel

    • declare-statement:

      declare const a: number;
      declare function b(): number;
      declare class c {}
      declare module d {}
      declare namespace e {}
      declare enum f {}
      declare global {}
      declare module 'g' {}

      ⏭️ 👆All statements that begin with declare

CHANGELOG

CHANGELOG.md

License

MIT License © 2023-PRESENT xlboy

ts-type-hidden's People

Contributors

xlboy avatar liby avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.