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

[FEATURE] I want to know a type on argument of handler in function that requires file_id input #388

Open
MysticDoll opened this issue Nov 28, 2024 · 2 comments
Labels
feature request New feature or request

Comments

@MysticDoll
Copy link

Description of the problem being solved

When I DefineFunction like below, now file will be any type.

export const f = DefineFunction({
  ...
  input_parameters: {
    file: {
      type: Schema.slack.types.file_id,
    }
  }
});

export default SlackFunction(f, async ({ inputs }) => {
  const { file } = inputs;
});

Alternative solutions

Now developer can see its correct type with debug print on custom function. (But I've not done yet, so I don't know what is correct type of file_id input.)

Requirements

I think it is better that properties in input become correct type if Schema.slack.types.* is provided to input_parameters.

Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to those rules.

@WilliamBergamin WilliamBergamin added the feature request New feature or request label Nov 28, 2024
@WilliamBergamin
Copy link
Contributor

Hi @MysticDoll thanks for writing in 💯

If i'm understanding correctly you would like to get type inference for inputs from the function definition to the slack function handler?

@MysticDoll
Copy link
Author

If i'm understanding correctly you would like to get type inference for inputs from the function definition to the slack function handler?

@WilliamBergamin Yes, I want that.

When I set user_id type to input param named user then inputs.user become string type.

file_id or some custom type could become like above?

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

No branches or pull requests

2 participants