Skip to content

Export generic load() function, and generate type-only .d.ts files#51

Open
jasongwartz wants to merge 4 commits intomainfrom
jg/generic-load-fn
Open

Export generic load() function, and generate type-only .d.ts files#51
jasongwartz wants to merge 4 commits intomainfrom
jg/generic-load-fn

Conversation

@jasongwartz
Copy link
Copy Markdown
Contributor

No description provided.

/* DO NOT EDIT! */
/* istanbul ignore file */
/* eslint-disable */
import * as pklTypescript from "@pkl-community/pkl-typescript"
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.

these imports arent needed now right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

They are if we use custom types like pklTypescript.Any

Comment on lines -14 to +18
loadFromPath(configFile).then((config) => {
console.log("Loaded config values from Pkl:", JSON.stringify(config));
loadFromPath<ConfigSchema>(configFile)
.then((config) => {
console.log("Loaded config values from Pkl:", JSON.stringify(config));
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

These lines best illustrate what the expected change in usage would be

Copy link
Copy Markdown
Contributor

@jackkleeman jackkleeman left a comment

Choose a reason for hiding this comment

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

makes sense to me!

@jasongwartz jasongwartz marked this pull request as ready for review May 25, 2025 23:32
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.

2 participants