Update to Typescript 7 (#39987)
This commit is contained in:
1 parent
6844f4009a
commit
ecf9d23752
18 files changed
+397
-167
No files matched your search
@@ -36,7 +36,7 @@ const randomUpTo = max =>
|
||||
* @typedef {import('mastodon/store').AppDispatch} Dispatch
|
||||
* @typedef {import('mastodon/store').GetState} GetState
|
||||
* @typedef {import('redux').UnknownAction} UnknownAction
|
||||
* @typedef {function(Dispatch, GetState): Promise<void>} FallbackFunction
|
||||
* @typedef {(dispatch: Dispatch, getState: GetState) => Promise<void>} FallbackFunction
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -45,9 +45,9 @@ const randomUpTo = max =>
|
||||
* @param {Object.<string, string>} params
|
||||
* @param {Object} options
|
||||
* @param {FallbackFunction} [options.fallback]
|
||||
* @param {function(): UnknownAction} [options.fillGaps]
|
||||
* @param {function(object): boolean} [options.accept]
|
||||
* @returns {function(): void}
|
||||
* @param {() => UnknownAction} [options.fillGaps]
|
||||
* @param {(status: object) => boolean} [options.accept]
|
||||
* @returns {() => void}
|
||||
*/
|
||||
export const connectTimelineStream = (timelineId, channelName, params = {}, options = {}) => {
|
||||
const { messages } = getLocale();
|
||||
@@ -159,7 +159,7 @@ async function refreshHomeTimelineAndNotification(dispatch) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {function(): void}
|
||||
* @returns {() => void}
|
||||
*/
|
||||
export const connectUserStream = () =>
|
||||
connectTimelineStream('home', 'user', {}, {
|
||||
@@ -171,7 +171,7 @@ export const connectUserStream = () =>
|
||||
/**
|
||||
* @param {Object} options
|
||||
* @param {boolean} [options.onlyMedia]
|
||||
* @returns {function(): void}
|
||||
* @returns {() => void}
|
||||
*/
|
||||
export const connectCommunityStream = ({ onlyMedia } = {}) =>
|
||||
connectTimelineStream(`community${onlyMedia ? ':media' : ''}`, `public:local${onlyMedia ? ':media' : ''}`, {}, {
|
||||
@@ -183,7 +183,7 @@ export const connectCommunityStream = ({ onlyMedia } = {}) =>
|
||||
* @param {Object} options
|
||||
* @param {boolean} [options.onlyMedia]
|
||||
* @param {boolean} [options.onlyRemote]
|
||||
* @returns {function(): void}
|
||||
* @returns {() => void}
|
||||
*/
|
||||
export const connectPublicStream = ({ onlyMedia, onlyRemote } = {}) =>
|
||||
connectTimelineStream(`public${onlyRemote ? ':remote' : ''}${onlyMedia ? ':media' : ''}`, `public${onlyRemote ? ':remote' : ''}${onlyMedia ? ':media' : ''}`, {}, {
|
||||
@@ -195,21 +195,21 @@ export const connectPublicStream = ({ onlyMedia, onlyRemote } = {}) =>
|
||||
* @param {string} columnId
|
||||
* @param {string} tagName
|
||||
* @param {boolean} onlyLocal
|
||||
* @param {function(object): boolean} accept
|
||||
* @returns {function(): void}
|
||||
* @param {(status: object) => boolean} accept
|
||||
* @returns {() => void}
|
||||
*/
|
||||
export const connectHashtagStream = (columnId, tagName, onlyLocal, accept) =>
|
||||
connectTimelineStream(`hashtag:${columnId}${onlyLocal ? ':local' : ''}`, `hashtag${onlyLocal ? ':local' : ''}`, { tag: tagName }, { accept });
|
||||
|
||||
/**
|
||||
* @returns {function(): void}
|
||||
* @returns {() => void}
|
||||
*/
|
||||
export const connectDirectStream = () =>
|
||||
connectTimelineStream('direct', 'direct');
|
||||
|
||||
/**
|
||||
* @param {string} listId
|
||||
* @returns {function(): void}
|
||||
* @returns {() => void}
|
||||
*/
|
||||
export const connectListStream = listId =>
|
||||
connectTimelineStream(`list:${listId}`, 'list', { list: listId }, {
|
||||
|
||||
Reference in new issue
Block a user