Skip to content

Feat/General improvements of the TS types#263

Merged
Mortaro merged 6 commits intonullstack:unstable-nextfrom
mayconfsousa:feat/ts-types
Aug 27, 2022
Merged

Feat/General improvements of the TS types#263
Mortaro merged 6 commits intonullstack:unstable-nextfrom
mayconfsousa:feat/ts-types

Conversation

@mayconfsousa
Copy link
Copy Markdown
Contributor

  • General improvement of TS types

  • Improved NullstackClientContext interface. Now we are using generics to inject extra props and to define the type of the binded value.

interface NullstackClientContext<
  TProps, // Type of the component props. 
  TBindValue, // Type of the bind value. The property `value` will be typed.
>
import Nullstack, { NullstackClientContext } from 'nullstack';

interface Props {
  text: string;
}

export default class Example extends Nullstack<Props> {
  hydrate({ bind, value }: NullstackClientContext<Props, string>) {
    console.log({ bind, value });
  }

  render({ text }: NullstackClientContext<Props, string>) {
    return <p>{text}</p>;
  }
}
<Example text="Hello world!" bind={this.bindValue} />

@mayconfsousa mayconfsousa changed the title Feat/TS types improvements Feat/General improvement of TS types Aug 26, 2022
@mayconfsousa mayconfsousa changed the title Feat/General improvement of TS types Feat/General improvements of the TS types Aug 26, 2022
@Mortaro Mortaro changed the base branch from next to unstable-next August 27, 2022 20:41
@Mortaro Mortaro merged commit 6133ded into nullstack:unstable-next Aug 27, 2022

// All the WAI-ARIA 1.1 attributes from https://www.w3.org/TR/wai-aria-1.1/
export interface AriaAttributes {
/** Identifies the currently active element when DOM focus is on a composite widget, textbox, group, or applicatio */
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is applicatio correct in the comment?

@mayconfsousa mayconfsousa deleted the feat/ts-types branch August 29, 2022 13:07
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

Successfully merging this pull request may close these issues.

3 participants