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 completion in ModalComponent #1813

Closed
risalfajar opened this issue Aug 2, 2023 · 5 comments
Closed

Code completion in ModalComponent #1813

risalfajar opened this issue Aug 2, 2023 · 5 comments
Assignees
Labels
feature request Request a feature or introduce and update to the project.
Milestone

Comments

@risalfajar
Copy link
Contributor

Describe the feature in detail (code, mocks, or screenshots encouraged)

We can provide code completion by using Typescript generics in ModalComponent:

import { ComponentProps, SvelteComponent } from "svelte"

export declare type Constructor<T> = new (...args: any[]) => T;

export interface ModalComponent<T extends SvelteComponent> {
	/** Import and provide your component reference. */
	ref: Constructor<T>;
	/** Provide component props as key/value pairs. */
	props?: ComponentProps<T>;
	/** Provide an HTML template literal for the default slot. */
	slot?: string;
}

What type of pull request would this be?

Enhancement

Provide relevant links or additional information.

Code is taken from https://github.com/bryanmylee/svelte-render/blob/main/src/lib/createRender.ts

@risalfajar risalfajar added the feature request Request a feature or introduce and update to the project. label Aug 2, 2023
@endigo9740
Copy link
Contributor

@AdrianGonz97 given you're taking a look at the Modal store soon, I thought I might bring this to your attention. We've had similar requests in the past. If you think it's better to handle separately that's fine too.

@endigo9740
Copy link
Contributor

See also: #1188

@HugeLetters
Copy link
Contributor

HugeLetters commented Sep 21, 2023

@endigo9740 hi, as previously discussed I would like to take a shot at this issue as well - no promises tho since it seems like a much harder task than with Autocomplete ;)

@endigo9740
Copy link
Contributor

@HugeLetters go for it. I'll assign this to you now. Thanks for your continued help!

@endigo9740
Copy link
Contributor

In an effort to prepare for Skeleton v3, we're consolidate some related issues down to a single ticket. This will ensure that we can see the full context of requests when the time comes to refactor and update this feature going forward. If you wish to add additional feedback or suggestions, please so here:

@endigo9740 endigo9740 modified the milestones: v3.0 (Next), v2.0 Jan 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Request a feature or introduce and update to the project.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants