Skip to content
Myr

fix(types): infer `path` when chaining after `use` (#3087)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Yusuke Wada · committed by GitHub · parent 1e3e58b · Browse files · 2 files+582 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+582 added−0 removed

  • tests:+387 added−0 removed
  • other:+195 added−0 removed

2 files+582 added−0 removed

modified:src/types.test.ts+387 added
1836 unmodified lines
1837 return c.json({ success: true })1838 })1839 })1840})18411842describe('Env types and a path type with `app.use(path, handler...)` - test only types', () => {1843 it('Should not throw a type error', () => {1844 type Env = {1845 Variables: {1846 foo: string1847 }1848 }18491850 // app.use(path, handler)1851 new Hono<Env>()1852 .use('/:id', async (c, next) => {1853 expectTypeOf(c.var.foo).toEqualTypeOf<string>()1854 expectTypeOf(c.req.param('id')).toEqualTypeOf<string>()1855 await next()1856 })1857 .get((c) => {1858 expectTypeOf(c.var.foo).toEqualTypeOf<string>()1859 expectTypeOf(c.req.param('id')).toEqualTypeOf<string>()1860 return c.json(0)1861 })18621863 // app.use(path, handler x2)1864 new Hono<Env>()1865 .use(1866 '/:id',1867 async (c, next) => {1868 expectTypeOf(c.var.foo).toEqualTypeOf<string>()1869 expectTypeOf(c.req.param('id')).toEqualTypeOf<string>()1870 await next()1871 },1872 async (c, next) => {1873 expectTypeOf(c.var.foo).toEqualTypeOf<string>()1874 expectTypeOf(c.req.param('id')).toEqualTypeOf<string>()1875 await next()1876 }1877 )1878 .get((c) => {1879 expectTypeOf(c.var.foo).toEqualTypeOf<string>()1880 expectTypeOf(c.req.param('id')).toEqualTypeOf<string>()1881 return c.json(0)1882 })18831884 // app.use(path, handler x3)1885 new Hono<Env>()1886 .use(1887 '/:id',1888 async (c, next) => {1889 expectTypeOf(c.var.foo).toEqualTypeOf<string>()1890 expectTypeOf(c.req.param('id')).toEqualTypeOf<string>()1891 await next()1892 },1893 async (c, next) => {1894 expectTypeOf(c.var.foo).toEqualTypeOf<string>()1895 expectTypeOf(c.req.param('id')).toEqualTypeOf<string>()1896 await next()1897 },1898 async (c, next) => {1899 expectTypeOf(c.var.foo).toEqualTypeOf<string>()1900 expectTypeOf(c.req.param('id')).toEqualTypeOf<string>()1901 await next()1902 }1903 )1904 .get((c) => {1905 expectTypeOf(c.var.foo).toEqualTypeOf<string>()1906 expectTypeOf(c.req.param('id')).toEqualTypeOf<string>()1907 return c.json(0)1908 })19091910 // app.use(path, handler x4)1911 new Hono<Env>()1912 .use(1913 '/:id',1914 async (c, next) => {1915 expectTypeOf(c.var.foo).toEqualTypeOf<string>()1916 expectTypeOf(c.req.param('id')).toEqualTypeOf<string>()1917 await next()1918 },1919 async (c, next) => {1920 expectTypeOf(c.var.foo).toEqualTypeOf<string>()1921 expectTypeOf(c.req.param('id')).toEqualTypeOf<string>()1922 await next()1923 },1924 async (c, next) => {1925 expectTypeOf(c.var.foo).toEqualTypeOf<string>()1926 expectTypeOf(c.req.param('id')).toEqualTypeOf<string>()1927 await next()1928 },1929 async (c, next) => {1930 expectTypeOf(c.var.foo).toEqualTypeOf<string>()1931 expectTypeOf(c.req.param('id')).toEqualTypeOf<string>()1932 await next()1933 }1934 )1935 .get((c) => {1936 expectTypeOf(c.var.foo).toEqualTypeOf<string>()1937 expectTypeOf(c.req.param('id')).toEqualTypeOf<string>()1938 return c.json(0)1939 })19401941 // app.use(path, handler x5)1942 new Hono<Env>()1943 .use(1944 '/:id',1945 async (c, next) => {1946 expectTypeOf(c.var.foo).toEqualTypeOf<string>()1947 expectTypeOf(c.req.param('id')).toEqualTypeOf<string>()1948 await next()1949 },1950 async (c, next) => {1951 expectTypeOf(c.var.foo).toEqualTypeOf<string>()1952 expectTypeOf(c.req.param('id')).toEqualTypeOf<string>()1953 await next()1954 },1955 async (c, next) => {1956 expectTypeOf(c.var.foo).toEqualTypeOf<string>()1957 expectTypeOf(c.req.param('id')).toEqualTypeOf<string>()1958 await next()1959 },1960 async (c, next) => {1961 expectTypeOf(c.var.foo).toEqualTypeOf<string>()1962 expectTypeOf(c.req.param('id')).toEqualTypeOf<string>()1963 await next()1964 },1965 async (c, next) => {1966 expectTypeOf(c.var.foo).toEqualTypeOf<string>()1967 expectTypeOf(c.req.param('id')).toEqualTypeOf<string>()1968 await next()1969 }1970 )1971 .get((c) => {1972 expectTypeOf(c.var.foo).toEqualTypeOf<string>()1973 expectTypeOf(c.req.param('id')).toEqualTypeOf<string>()1974 return c.json(0)1975 })19761977 // app.use(path, handler x6)1978 new Hono<Env>()1979 .use(1980 '/:id',1981 async (c, next) => {1982 expectTypeOf(c.var.foo).toEqualTypeOf<string>()1983 expectTypeOf(c.req.param('id')).toEqualTypeOf<string>()1984 await next()1985 },1986 async (c, next) => {1987 expectTypeOf(c.var.foo).toEqualTypeOf<string>()1988 expectTypeOf(c.req.param('id')).toEqualTypeOf<string>()1989 await next()1990 },1991 async (c, next) => {1992 expectTypeOf(c.var.foo).toEqualTypeOf<string>()1993 expectTypeOf(c.req.param('id')).toEqualTypeOf<string>()1994 await next()1995 },1996 async (c, next) => {1997 expectTypeOf(c.var.foo).toEqualTypeOf<string>()1998 expectTypeOf(c.req.param('id')).toEqualTypeOf<string>()1999 await next()2000 },2001 async (c, next) => {2002 expectTypeOf(c.var.foo).toEqualTypeOf<string>()2003 expectTypeOf(c.req.param('id')).toEqualTypeOf<string>()2004 await next()2005 },2006 async (c, next) => {2007 expectTypeOf(c.var.foo).toEqualTypeOf<string>()2008 expectTypeOf(c.req.param('id')).toEqualTypeOf<string>()2009 await next()2010 }2011 )2012 .get((c) => {2013 expectTypeOf(c.var.foo).toEqualTypeOf<string>()2014 expectTypeOf(c.req.param('id')).toEqualTypeOf<string>()2015 return c.json(0)2016 })20172018 // app.use(path, handler x7)2019 new Hono<Env>()2020 .use(2021 '/:id',2022 async (c, next) => {2023 expectTypeOf(c.var.foo).toEqualTypeOf<string>()2024 expectTypeOf(c.req.param('id')).toEqualTypeOf<string>()2025 await next()2026 },2027 async (c, next) => {2028 expectTypeOf(c.var.foo).toEqualTypeOf<string>()2029 expectTypeOf(c.req.param('id')).toEqualTypeOf<string>()2030 await next()2031 },2032 async (c, next) => {2033 expectTypeOf(c.var.foo).toEqualTypeOf<string>()2034 expectTypeOf(c.req.param('id')).toEqualTypeOf<string>()2035 await next()2036 },2037 async (c, next) => {2038 expectTypeOf(c.var.foo).toEqualTypeOf<string>()2039 expectTypeOf(c.req.param('id')).toEqualTypeOf<string>()2040 await next()2041 },2042 async (c, next) => {2043 expectTypeOf(c.var.foo).toEqualTypeOf<string>()2044 expectTypeOf(c.req.param('id')).toEqualTypeOf<string>()2045 await next()2046 },2047 async (c, next) => {2048 expectTypeOf(c.var.foo).toEqualTypeOf<string>()2049 expectTypeOf(c.req.param('id')).toEqualTypeOf<string>()2050 await next()2051 },2052 async (c, next) => {2053 expectTypeOf(c.var.foo).toEqualTypeOf<string>()2054 expectTypeOf(c.req.param('id')).toEqualTypeOf<string>()2055 await next()2056 }2057 )2058 .get((c) => {2059 expectTypeOf(c.var.foo).toEqualTypeOf<string>()2060 expectTypeOf(c.req.param('id')).toEqualTypeOf<string>()2061 return c.json(0)2062 })20632064 // app.use(path, handler x8)2065 new Hono<Env>()2066 .use(2067 '/:id',2068 async (c, next) => {2069 expectTypeOf(c.var.foo).toEqualTypeOf<string>()2070 expectTypeOf(c.req.param('id')).toEqualTypeOf<string>()2071 await next()2072 },2073 async (c, next) => {2074 expectTypeOf(c.var.foo).toEqualTypeOf<string>()2075 expectTypeOf(c.req.param('id')).toEqualTypeOf<string>()2076 await next()2077 },2078 async (c, next) => {2079 expectTypeOf(c.var.foo).toEqualTypeOf<string>()2080 expectTypeOf(c.req.param('id')).toEqualTypeOf<string>()2081 await next()2082 },2083 async (c, next) => {2084 expectTypeOf(c.var.foo).toEqualTypeOf<string>()2085 expectTypeOf(c.req.param('id')).toEqualTypeOf<string>()2086 await next()2087 },2088 async (c, next) => {2089 expectTypeOf(c.var.foo).toEqualTypeOf<string>()2090 expectTypeOf(c.req.param('id')).toEqualTypeOf<string>()2091 await next()2092 },2093 async (c, next) => {2094 expectTypeOf(c.var.foo).toEqualTypeOf<string>()2095 expectTypeOf(c.req.param('id')).toEqualTypeOf<string>()2096 await next()2097 },2098 async (c, next) => {2099 expectTypeOf(c.var.foo).toEqualTypeOf<string>()2100 expectTypeOf(c.req.param('id')).toEqualTypeOf<string>()2101 await next()2102 },2103 async (c, next) => {2104 expectTypeOf(c.var.foo).toEqualTypeOf<string>()2105 expectTypeOf(c.req.param('id')).toEqualTypeOf<string>()2106 await next()2107 }2108 )2109 .get((c) => {2110 expectTypeOf(c.var.foo).toEqualTypeOf<string>()2111 expectTypeOf(c.req.param('id')).toEqualTypeOf<string>()2112 return c.json(0)2113 })21142115 // app.use(path, handler x9)2116 new Hono<Env>()2117 .use(2118 '/:id',2119 async (c, next) => {2120 expectTypeOf(c.var.foo).toEqualTypeOf<string>()2121 expectTypeOf(c.req.param('id')).toEqualTypeOf<string>()2122 await next()2123 },2124 async (c, next) => {2125 expectTypeOf(c.var.foo).toEqualTypeOf<string>()2126 expectTypeOf(c.req.param('id')).toEqualTypeOf<string>()2127 await next()2128 },2129 async (c, next) => {2130 expectTypeOf(c.var.foo).toEqualTypeOf<string>()2131 expectTypeOf(c.req.param('id')).toEqualTypeOf<string>()2132 await next()2133 },2134 async (c, next) => {2135 expectTypeOf(c.var.foo).toEqualTypeOf<string>()2136 expectTypeOf(c.req.param('id')).toEqualTypeOf<string>()2137 await next()2138 },2139 async (c, next) => {2140 expectTypeOf(c.var.foo).toEqualTypeOf<string>()2141 expectTypeOf(c.req.param('id')).toEqualTypeOf<string>()2142 await next()2143 },2144 async (c, next) => {2145 expectTypeOf(c.var.foo).toEqualTypeOf<string>()2146 expectTypeOf(c.req.param('id')).toEqualTypeOf<string>()2147 await next()2148 },2149 async (c, next) => {2150 expectTypeOf(c.var.foo).toEqualTypeOf<string>()2151 expectTypeOf(c.req.param('id')).toEqualTypeOf<string>()2152 await next()2153 },2154 async (c, next) => {2155 expectTypeOf(c.var.foo).toEqualTypeOf<string>()2156 expectTypeOf(c.req.param('id')).toEqualTypeOf<string>()2157 await next()2158 },2159 async (c, next) => {2160 expectTypeOf(c.var.foo).toEqualTypeOf<string>()2161 expectTypeOf(c.req.param('id')).toEqualTypeOf<string>()2162 await next()2163 }2164 )2165 .get((c) => {2166 expectTypeOf(c.var.foo).toEqualTypeOf<string>()2167 expectTypeOf(c.req.param('id')).toEqualTypeOf<string>()2168 return c.json(0)2169 })21702171 // app.use(path, handler x10)2172 new Hono<Env>()2173 .use(2174 '/:id',2175 async (c, next) => {2176 expectTypeOf(c.var.foo).toEqualTypeOf<string>()2177 expectTypeOf(c.req.param('id')).toEqualTypeOf<string>()2178 await next()2179 },2180 async (c, next) => {2181 expectTypeOf(c.var.foo).toEqualTypeOf<string>()2182 expectTypeOf(c.req.param('id')).toEqualTypeOf<string>()2183 await next()2184 },2185 async (c, next) => {2186 expectTypeOf(c.var.foo).toEqualTypeOf<string>()2187 expectTypeOf(c.req.param('id')).toEqualTypeOf<string>()2188 await next()2189 },2190 async (c, next) => {2191 expectTypeOf(c.var.foo).toEqualTypeOf<string>()2192 expectTypeOf(c.req.param('id')).toEqualTypeOf<string>()2193 await next()2194 },2195 async (c, next) => {2196 expectTypeOf(c.var.foo).toEqualTypeOf<string>()2197 expectTypeOf(c.req.param('id')).toEqualTypeOf<string>()2198 await next()2199 },2200 async (c, next) => {2201 expectTypeOf(c.var.foo).toEqualTypeOf<string>()2202 expectTypeOf(c.req.param('id')).toEqualTypeOf<string>()2203 await next()2204 },2205 async (c, next) => {2206 expectTypeOf(c.var.foo).toEqualTypeOf<string>()2207 expectTypeOf(c.req.param('id')).toEqualTypeOf<string>()2208 await next()2209 },2210 async (c, next) => {2211 expectTypeOf(c.var.foo).toEqualTypeOf<string>()2212 expectTypeOf(c.req.param('id')).toEqualTypeOf<string>()2213 await next()2214 },2215 async (c, next) => {2216 expectTypeOf(c.var.foo).toEqualTypeOf<string>()2217 expectTypeOf(c.req.param('id')).toEqualTypeOf<string>()2218 await next()2219 }2220 )2221 .get((c) => {2222 expectTypeOf(c.var.foo).toEqualTypeOf<string>()2223 expectTypeOf(c.req.param('id')).toEqualTypeOf<string>()2224 return c.json(0)2225 })2226 })2227})
modified:src/types.ts+195 added
699 unmodified lines
700 >(701 ...handlers: [MiddlewareHandler<E2, P>, MiddlewareHandler<E3, P>]702 ): Hono<IntersectNonAnyTypes<[E, E2, E3]>, S, BasePath>703704 // app.get(path, handler)705 <706 P extends string,707 MergedPath extends MergePath<BasePath, P> = MergePath<BasePath, P>,708 E2 extends Env = E709 >(710 path: P,711 handler: MiddlewareHandler<E2, MergedPath>712 ): Hono<IntersectNonAnyTypes<[E, E2]>, ChangePathOfSchema<S, MergedPath>, BasePath>713714 // app.use(handler x3)715 <716 E2 extends Env = E,717 E3 extends Env = E,
2 unmodified lines
720 >(721 ...handlers: [MiddlewareHandler<E2, P>, MiddlewareHandler<E3, P>, MiddlewareHandler<E4, P>]722 ): Hono<IntersectNonAnyTypes<[E, E2, E3, E4]>, S, BasePath>723724 // app.get(path, handler x2)725 <726 P extends string,727 MergedPath extends MergePath<BasePath, P> = MergePath<BasePath, P>,728 E2 extends Env = E,729 E3 extends Env = IntersectNonAnyTypes<[E, E2]>730 >(731 path: P,732 ...handlers: [MiddlewareHandler<E2, P>, MiddlewareHandler<E3, P>]733 ): Hono<IntersectNonAnyTypes<[E, E2, E3]>, ChangePathOfSchema<S, MergedPath>, BasePath>734735 // app.use(handler x4)736 <737 E2 extends Env = E,738 E3 extends Env = E,
8 unmodified lines
747 MiddlewareHandler<E5, P>748 ]749 ): Hono<IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, S, BasePath>750751 // app.get(path, handler x3)752 <753 P extends string,754 MergedPath extends MergePath<BasePath, P> = MergePath<BasePath, P>,755 E2 extends Env = E,756 E3 extends Env = E,757 E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>758 >(759 path: P,760 ...handlers: [MiddlewareHandler<E2, P>, MiddlewareHandler<E3, P>, MiddlewareHandler<E4, P>]761 ): Hono<IntersectNonAnyTypes<[E, E2, E3, E4]>, ChangePathOfSchema<S, MergedPath>, BasePath>762763 // app.use(handler x5)764 <765 E2 extends Env = E,766 E3 extends Env = E,
10 unmodified lines
777 MiddlewareHandler<E6, P>778 ]779 ): Hono<IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, S, BasePath>780781 // app.get(path, handler x4)782 <783 P extends string,784 MergedPath extends MergePath<BasePath, P> = MergePath<BasePath, P>,785 E2 extends Env = E,786 E3 extends Env = E,787 E4 extends Env = E,788 E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>789 >(790 path: P,791 ...handlers: [792 MiddlewareHandler<E2, P>,793 MiddlewareHandler<E3, P>,794 MiddlewareHandler<E4, P>,795 MiddlewareHandler<E5, P>796 ]797 ): Hono<IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, ChangePathOfSchema<S, MergedPath>, BasePath>798799 // app.use(handler x6)800 <801 E2 extends Env = E,802 E3 extends Env = E,
12 unmodified lines
815 MiddlewareHandler<E7, P>816 ]817 ): Hono<IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, S, BasePath>818819 // app.get(path, handler x5)820 <821 P extends string,822 MergedPath extends MergePath<BasePath, P> = MergePath<BasePath, P>,823 E2 extends Env = E,824 E3 extends Env = E,825 E4 extends Env = E,826 E5 extends Env = E,827 E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>828 >(829 path: P,830 ...handlers: [831 MiddlewareHandler<E2, P>,832 MiddlewareHandler<E3, P>,833 MiddlewareHandler<E4, P>,834 MiddlewareHandler<E5, P>,835 MiddlewareHandler<E6, P>836 ]837 ): Hono<838 IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>,839 ChangePathOfSchema<S, MergedPath>,840 BasePath841 >842843 // app.use(handler x7)844 <845 E2 extends Env = E,846 E3 extends Env = E,
14 unmodified lines
861 MiddlewareHandler<E8, P>862 ]863 ): Hono<IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>, S, BasePath>864865 // app.get(path, handler x6)866 <867 P extends string,868 MergedPath extends MergePath<BasePath, P> = MergePath<BasePath, P>,869 E2 extends Env = E,870 E3 extends Env = E,871 E4 extends Env = E,872 E5 extends Env = E,873 E6 extends Env = E,874 E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>875 >(876 path: P,877 ...handlers: [878 MiddlewareHandler<E2, P>,879 MiddlewareHandler<E3, P>,880 MiddlewareHandler<E4, P>,881 MiddlewareHandler<E5, P>,882 MiddlewareHandler<E6, P>,883 MiddlewareHandler<E7, P>884 ]885 ): Hono<886 IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>,887 ChangePathOfSchema<S, MergedPath>,888 BasePath889 >890891 // app.use(handler x8)892 <893 E2 extends Env = E,894 E3 extends Env = E,
16 unmodified lines
911 MiddlewareHandler<E9, P>912 ]913 ): Hono<IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9]>, S, BasePath>914915 // app.get(path, handler x7)916 <917 P extends string,918 MergedPath extends MergePath<BasePath, P> = MergePath<BasePath, P>,919 E2 extends Env = E,920 E3 extends Env = E,921 E4 extends Env = E,922 E5 extends Env = E,923 E6 extends Env = E,924 E7 extends Env = E,925 E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>926 >(927 path: P,928 ...handlers: [929 MiddlewareHandler<E2, P>,930 MiddlewareHandler<E3, P>,931 MiddlewareHandler<E4, P>,932 MiddlewareHandler<E5, P>,933 MiddlewareHandler<E6, P>,934 MiddlewareHandler<E7, P>,935 MiddlewareHandler<E8, P>936 ]937 ): Hono<938 IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>,939 ChangePathOfSchema<S, MergedPath>,940 BasePath941 >942943 // app.use(handler x9)944 <945 E2 extends Env = E,946 E3 extends Env = E,
18 unmodified lines
965 MiddlewareHandler<E10, P>966 ]967 ): Hono<IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9, E10]>, S, BasePath>968969 // app.get(path, handler x8)970 <971 P extends string,972 MergedPath extends MergePath<BasePath, P> = MergePath<BasePath, P>,973 E2 extends Env = E,974 E3 extends Env = E,975 E4 extends Env = E,976 E5 extends Env = E,977 E6 extends Env = E,978 E7 extends Env = E,979 E8 extends Env = E,980 E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>981 >(982 path: P,983 ...handlers: [984 MiddlewareHandler<E2, P>,985 MiddlewareHandler<E3, P>,986 MiddlewareHandler<E4, P>,987 MiddlewareHandler<E5, P>,988 MiddlewareHandler<E6, P>,989 MiddlewareHandler<E7, P>,990 MiddlewareHandler<E8, P>,991 MiddlewareHandler<E9, P>992 ]993 ): Hono<994 IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9]>,995 ChangePathOfSchema<S, MergedPath>,996 BasePath997 >998999 // app.use(handler x10)1000 <1001 E2 extends Env = E,1002 E3 extends Env = E,
20 unmodified lines
1023 MiddlewareHandler<E11, P>1024 ]1025 ): Hono<IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9, E10, E11]>, S, BasePath>10261027 // app.get(path, handler x9)1028 <1029 P extends string,1030 MergedPath extends MergePath<BasePath, P> = MergePath<BasePath, P>,1031 E2 extends Env = E,1032 E3 extends Env = E,1033 E4 extends Env = E,1034 E5 extends Env = E,1035 E6 extends Env = E,1036 E7 extends Env = E,1037 E8 extends Env = E,1038 E9 extends Env = E,1039 E10 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9]>1040 >(1041 path: P,1042 ...handlers: [1043 MiddlewareHandler<E2, P>,1044 MiddlewareHandler<E3, P>,1045 MiddlewareHandler<E4, P>,1046 MiddlewareHandler<E5, P>,1047 MiddlewareHandler<E6, P>,1048 MiddlewareHandler<E7, P>,1049 MiddlewareHandler<E8, P>,1050 MiddlewareHandler<E9, P>,1051 MiddlewareHandler<E10, P>1052 ]1053 ): Hono<1054 IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9, E10]>,1055 ChangePathOfSchema<S, MergedPath>,1056 BasePath1057 >10581059 //// app.use(path, ...handlers[])1060 <P extends string, E2 extends Env = E>(1061 path: P,1062 ...handlers: MiddlewareHandler<E2, MergePath<BasePath, P>>[]
739 unmodified lines
1802 [Method: `$${Lowercase<string>}`]: Endpoint1803 }1804}18051806type ChangePathOfSchema<S extends Schema, Path extends string> = keyof S extends never1807 ? { [K in Path]: never }1808 : { [K in keyof S as Path]: S[K] }18091810export type Endpoint = {1811 input: Partial<ValidationTargets>1812 output: any1813 outputFormat: ResponseFormat
193 unmodified lines