Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

code-surfer-types missing from published package #116

Open
karlhorky opened this issue May 16, 2021 · 1 comment
Open

code-surfer-types missing from published package #116

karlhorky opened this issue May 16, 2021 · 1 comment

Comments

@karlhorky
Copy link

It seems like the code-surfer-types module is missing from the published package:

Screen Shot 2021-05-16 at 12 29 14

And installing it using npm / yarn doesn't work either:

yarn add --dev code-surfer-types
yarn add v1.22.10
[1/4] 🔍  Resolving packages...
error An unexpected error occurred: "https://registry.yarnpkg.com/code-surfer-types: Not found".
info If you think this is a bug, please open a bug report with the information provided in "/Users/k/p/courses/slide-decks-new/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
@karlhorky
Copy link
Author

Workaround for anyone if this doesn't get fixed anytime soon:

Add the following file to your project with the contents of types.d.ts, which are missing from the published package:

code-surfer-types.d.ts

type Maybe<T> = T | null | undefined;

declare module "code-surfer-types" {
  export interface InputStep {
    code: string;
    focus?: string;
    title?: { value: string };
    subtitle?: { value: string };
    lang?: string;
  }

  export interface Token {
    type: string;
    content: string;
    focus?: boolean;
    key?: number;
  }

  export interface Line {
    tokens: Token[];
    key: Number;
    content: string;
    focus?: boolean;
    focusPerToken?: boolean;
  }

  export interface Step {
    lines: Line[];
    title?: { value: string };
    subtitle?: { value: string };
    focusCenter: number;
    dimensions?: any;
  }

  type StyleItem = {
    types: string[];
    style: React.CSSProperties;
  };

  type Partial<T> = {
    [P in keyof T]?: T[P];
  };
}

declare module "playhead-types" {
  type Animation<T, R> = (prev: Maybe<T>, next: Maybe<T>, t: number) => R;
  type AnimationConfig<T> = {
    when?: (prev: Maybe<T>, next: Maybe<T>) => boolean;
    stagger?: number;
  };
  type AnimationAndConfig<T, R> = {
    animation: Animation<T, R>;
  } & AnimationConfig<T>;
}

declare module "shell-quote" {
  export function parse(s: string): string[];
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant