-
Notifications
You must be signed in to change notification settings - Fork 399
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
Missing type declarations for HomeView #1454
Comments
Hi @JustStanix, thanks for taking the time to report this issue. You are right that the type definition for Apart from that, I would suggest using app.event('app_home_opened', async ({ context }) => {
console.log(`context.teamId: ${context.teamId}`);
}); |
Hi @seratch! Thank you for the suggestion, that fixes my issue. |
I also noticed that HomeView type doesn't include some fields, such as My received payload is view: {
id: 'V03GMKH4T5E',
team_id: 'T01PY724468',
app_id: 'A034D9Y4U5T',
app_installed_team_id: 'T01PY724468',
bot_id: 'B03GMK1H5AL',
type: 'home',
blocks: [ [Object], [Object], [Object] ],
state: { values: {} },
hash: '1652879745.kmcdqLgk',
private_metadata: '',
callback_id: '',
root_view_id: 'V03GMKH4T5E',
external_id: '',
title: { type: 'plain_text', text: 'View Title', emoji: true },
close: null,
submit: null,
previous_view_id: null,
clear_on_close: false,
notify_on_close: false
} whereas HomeView is declared as export interface HomeView {
type: 'home';
blocks: (KnownBlock | Block)[];
private_metadata?: string;
callback_id?: string;
external_id?: string;
} |
Hey @AlexisTonneau I posted your comment as an issue in the appropriate repo housing that particular type: slackapi/node-slack-sdk#1486. We can continue discussion on your observation / issue over there. |
hey, |
Description
TS2339: Property 'team_id' does not exist on type 'View'. Property 'team_id' does not exist on type 'HomeView'.
From my understanding of the Slack API documentation, the
app_home_opened
event should always contain ateam_id
inevent.view
. If so then HomeView is missing type declarations for this.What type of issue is this? (place an
x
in one of the[ ]
)Requirements (place an
x
in each of the[ ]
)Bug Report
Filling out the following details about bugs will help us solve your issue sooner.
Reproducible in:
package version: 3.3.0
node version: v16.4.2
OS version(s): Windows 11 Pro, WSL 2 (Ubuntu LTS)
Steps to reproduce:
app_home_opened
event listener.team_id
fromevent.view
Expected result:
What you expected to happen: TypeScript is happy :))
Actual result:
What actually happened: TypeScript is angy :(
The text was updated successfully, but these errors were encountered: