1"use strict";(self.webpackChunknonebot=self.webpackChunknonebot||[]).push([["3922"],{49872(e,n,s){s.r(n),s.d(n,{metadata:()=>i,default:()=>a,frontMatter:()=>t,contentTitle:()=>r,toc:()=>o,assets:()=>c});var i=JSON.parse('{"id":"api/dependencies/utils","title":"nonebot.dependencies.utils","description":"nonebot.dependencies.utils \u6A21\u5757","source":"@site/versioned_docs/version-2.4.3/api/dependencies/utils.md","sourceDirName":"api/dependencies","slug":"/api/dependencies/utils","permalink":"/docs/2.4.3/api/dependencies/utils","draft":false,"unlisted":false,"editUrl":"https://github.com/nonebot/nonebot2/edit/master/website/versioned_docs/version-2.4.3/api/dependencies/utils.md","tags":[],"version":"2.4.3","lastUpdatedBy":"noneflow[bot]","lastUpdatedAt":1756134133000,"sidebarPosition":1,"frontMatter":{"mdx":{"format":"md"},"sidebar_position":1,"description":"nonebot.dependencies.utils \u6A21\u5757"},"sidebar":"api","previous":{"title":"nonebot.dependencies","permalink":"/docs/2.4.3/api/dependencies/"},"next":{"title":"nonebot.drivers","permalink":"/docs/2.4.3/api/drivers/"}}'),d=s(62540),l=s(43023);let t={mdx:{format:"md"},sidebar_position:1,description:"nonebot.dependencies.utils \u6A21\u5757"},r="nonebot.dependencies.utils",c={},o=[{value:"<em>def</em> <code>get_typed_signature(call)</code>",id:"get-typed-signature",level:2},{value:"<em>def</em> <code>get_typed_annotation(param, globalns)</code>",id:"get-typed-annotation",level:2},{value:"<em>def</em> <code>check_field_type(field, value)</code>",id:"check-field-type",level:2}];function h(e){let n={a:"a",code:"code",em:"em",h1:"h1",h2:"h2",header:"header",li:"li",p:"p",strong:"strong",ul:"ul",...(0,l.R)(),...e.components};return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(n.header,{children:(0,d.jsx)(n.h1,{id:"nonebotdependenciesutils",children:"nonebot.dependencies.utils"})}),"\n",(0,d.jsxs)(n.h2,{id:"get-typed-signature",children:[(0,d.jsx)(n.em,{children:"def"})," ",(0,d.jsx)(n.code,{children:"get_typed_signature(call)"})]}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:["\n",(0,d.jsxs)(n.p,{children:[(0,d.jsx)(n.strong,{children:"\u8BF4\u660E:"})," \u83B7\u53D6\u53EF\u8C03\u7528\u5BF9\u8C61\u7B7E\u540D"]}),"\n"]}),"\n",(0,d.jsxs)(n.li,{children:["\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"\u53C2\u6570"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"call"})," ((...) -> Any)"]}),"\n"]}),"\n"]}),"\n",(0,d.jsxs)(n.li,{children:["\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"\u8FD4\u56DE"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsx)(n.li,{children:"inspect.Signature"}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,d.jsxs)(n.h2,{id:"get-typed-annotation",children:[(0,d.jsx)(n.em,{children:"def"})," ",(0,d.jsx)(n.code,{children:"get_typed_annotation(param, globalns)"})]}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:["\n",(0,d.jsxs)(n.p,{children:[(0,d.jsx)(n.strong,{children:"\u8BF4\u660E:"})," \u83B7\u53D6\u53C2\u6570\u7684\u7C7B\u578B\u6CE8\u89E3"]}),"\n"]}),"\n",(0,d.jsxs)(n.li,{children:["\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"\u53C2\u6570"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:["\n",(0,d.jsxs)(n.p,{children:[(0,d.jsx)(n.code,{children:"param"})," (inspect.Parameter)"]}),"\n"]}),"\n",(0,d.jsxs)(n.li,{children:["\n",(0,d.jsxs)(n.p,{children:[(0,d.jsx)(n.code,{children:"globalns"})," (dict[str, Any])"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,d.jsxs)(n.li,{children:["\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"\u8FD4\u56DE"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsx)(n.li,{children:"Any"}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,d.jsxs)(n.h2,{id:"check-field-type",children:[(0,d.jsx)(n.em,{children:"def"})," ",(0,d.jsx)(n.code,{children:"check_field_type(field, value)"})]}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:["\n",(0,d.jsxs)(n.p,{children:[(0,d.jsx)(n.strong,{children:"\u8BF4\u660E:"})," \u68C0\u67E5\u5B57\u6BB5\u7C7B\u578B\u662F\u5426\u5339\u914D"]}),"\n"]}),"\n",(0,d.jsxs)(n.li,{children:["\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"\u53C2\u6570"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:["\n",(0,d.jsxs)(n.p,{children:[(0,d.jsx)(n.code,{children:"field"})," (",(0,d.jsx)(n.a,{href:"/docs/2.4.3/api/compat#ModelField",children:"ModelField"}),")"]}),"\n"]}),"\n",(0,d.jsxs)(n.li,{children:["\n",(0,d.jsxs)(n.p,{children:[(0,d.jsx)(n.code,{children:"value"})," (Any)"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,d.jsxs)(n.li,{children:["\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.strong,{children:"\u8FD4\u56DE"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsx)(n.li,{children:"Any"}),"\n"]}),"\n"]}),"\n"]})]})}function a(e={}){let{wrapper:n}={...(0,l.R)(),...e.components};return n?(0,d.jsx)(n,{...e,children:(0,d.jsx)(h,{...e})}):h(e)}},43023(e,n,s){s.d(n,{R:()=>t,x:()=>r});var i=s(63696);let d={},l=i.createContext(d);function t(e){let n=i.useContext(l);return i.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function r(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(d):e.components||d:t(e.components),i.createElement(l.Provider,{value:n},e.children)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.