1"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[805],{13939:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>o,default:()=>h,frontMatter:()=>i,metadata:()=>a,toc:()=>d});var r=n(85893),s=n(11151);const i={sidebar_position:18,description:"Extract all method functions from self and bind self as their first named argument.",toc_max_heading_level:2},o="methods",a={id:"reference/utils/methods",title:"methods",description:"Extract all method functions from self and bind self as their first named argument.",source:"@site/docs/reference/utils/methods.mdx",sourceDirName:"reference/utils",slug:"/reference/utils/methods",permalink:"/docs/reference/utils/methods",draft:!1,unlisted:!1,tags:[],version:"current",sidebarPosition:18,frontMatter:{sidebar_position:18,description:"Extract all method functions from self and bind self as their first named argument.",toc_max_heading_level:2},sidebar:"tutorialSidebar",previous:{title:"method-wrapper",permalink:"/docs/reference/utils/method-wrapper"},next:{title:"capitalize",permalink:"/docs/reference/utils/capitalize"}},c={},d=[{value:"self : <TypeLink></TypeLink>",id:"self",level:3}];function l(e){const t={a:"a",code:"code",h1:"h1",h3:"h3",p:"p",strong:"strong",...(0,s.a)(),...e.components},{Param:n,Parameters:i,Signature:o,SignatureName:a,SignatureParam:c,SourceLink:d,TypeLink:l}=t;return n||u("Param",!0),i||u("Parameters",!0),o||u("Signature",!0),a||u("SignatureName",!0),c||u("SignatureParam",!0),d||u("SourceLink",!0),l||u("TypeLink",!0),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t.h1,{id:"methods",children:"methods"}),"\n",(0,r.jsx)(o,{children:(0,r.jsxs)("code",{children:[(0,r.jsx)(a,{children:"methods"}),"(",(0,r.jsx)(c,{children:(0,r.jsx)(t.a,{href:"#self",children:"self"})}),")",(0,r.jsx)(d,{href:"https://github.com/touying-typ/touying/blob/main/src/utils.typ#L398"})]})}),"\n",(0,r.jsxs)(t.p,{children:["Extract all method functions from ",(0,r.jsx)(t.code,{children:"self"})," and bind ",(0,r.jsx)(t.code,{children:"self"})," as their first named argument."]}),"\n",(0,r.jsxs)(t.p,{children:["Returns a dictionary of ready-to-call functions where the ",(0,r.jsx)(t.code,{children:"self"})," argument has already been applied. Use destructuring to get individual methods."]}),"\n",(0,r.jsxs)(t.p,{children:["Example: ",(0,r.jsx)(t.code,{children:"#let (uncover, only) = utils.methods(self)"})," to get ",(0,r.jsx)(t.code,{children:"uncover"})," and ",(0,r.jsx)(t.code,{children:"only"})," methods."]}),"\n",(0,r.jsxs)(i,{children:[(0,r.jsxs)(t.h3,{id:"self",children:["self : ",(0,r.jsx)(l,{type:"dictionary"})]}),(0,r.jsx)(n,{children:(0,r.jsxs)(t.p,{children:["The presentation context (must have a ",(0,r.jsx)(t.code,{children:"methods"})," key containing a dictionary of functions)."]})})]}),"\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.strong,{children:"Returns:"})," ",(0,r.jsx)(l,{type:"dictionary"})]})]})}function h(e={}){const{wrapper:t}={...(0,s.a)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(l,{...e})}):l(e)}function u(e,t){throw new Error("Expected "+(t?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}},11151:(e,t,n)=>{n.d(t,{Z:()=>a,a:()=>o});var r=n(67294);const s={},i=r.createContext(s);function o(e){const t=r.useContext(i);return r.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function a(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:o(e.components),r.createElement(i.Provider,{value:t},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.