@@ -163,18 +163,14 @@ end
163163-- API
164164--
165165
166- --- Create new api entries pointing legacy functions to current
167- --- @param api table
168- function M .map_api (api )
166+ --- Silently create new api entries pointing legacy functions to current
167+ function M .api_map (api )
169168 api .config = api .config or {}
170169 api .config .mappings = api .config .mappings or {}
171170 api .config .mappings .get_keymap = api .map .keymap .current
172171 api .config .mappings .get_keymap_default = api .map .keymap .default
173172 api .config .mappings .default_on_attach = api .map .on_attach .default
174173
175- api .git = api .git or {}
176- api .git .reload = api .tree .reload_git
177-
178174 api .live_filter = api .live_filter or {}
179175 api .live_filter .start = api .filter .live .start
180176 api .live_filter .clear = api .filter .live .clear
@@ -192,4 +188,54 @@ function M.map_api(api)
192188 api .diagnostics .hi_test = api .health .hi_test
193189end
194190
191+ --- Add meta definitions for deprecated API
192+ function M .api_meta (api )
193+ --- @deprecated nvim_tree.api.filter.toggle
194+ function api .tree .toggle_enable_filters () end
195+
196+ --- @deprecated nvim_tree.api.filter.git.ignored.toggle
197+ function api .tree .toggle_gitignore_filter () end
198+
199+ --- @deprecated nvim_tree.api.filter.git.clean.toggle
200+ function api .tree .toggle_git_clean_filter () end
201+
202+ --- @deprecated nvim_tree.api.filter.no_buffer.toggle
203+ function api .tree .toggle_no_buffer_filter () end
204+
205+ --- @deprecated nvim_tree.api.filter.custom.toggle
206+ function api .tree .toggle_custom_filter () end
207+
208+ --- @deprecated nvim_tree.api.filter.dotfiles.toggle
209+ function api .tree .toggle_hidden_filter () end
210+
211+ --- @deprecated nvim_tree.api.filter.no_bookmark.toggle
212+ function api .tree .toggle_no_bookmark_filter () end
213+
214+ api .config = { mappings = {} }
215+
216+ --- @deprecated nvim_tree.api.map.keymap.current
217+ function api .config .mappings .get_keymap () end
218+
219+ --- @deprecated nvim_tree.api.map.keymap.default
220+ function api .config .mappings .get_keymap_default () end
221+
222+ --- @deprecated nvim_tree.api.map.on_attach.default
223+ function api .config .mappings .default_on_attach (_ ) end
224+
225+ api .live_filter = {}
226+
227+ --- @deprecated nvim_tree.api.filter.live.start
228+ function api .live_filter .start () end
229+
230+ --- @deprecated nvim_tree.api.filter.live.clear
231+ function api .live_filter .clear () end
232+
233+ api .diagnostics = {}
234+
235+ --- @deprecated nvim_tree.api.health.hi_test
236+ function api .diagnostics .hi_test () end
237+
238+ return api
239+ end
240+
195241return M
0 commit comments